.schools-section {
  padding: 38px 24px 50px 24px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.schools-header h2 {
  font-size: 2.5rem;
  color: #0d3a80;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.schools-header p {
  font-size: 1.09rem;
  color: #555;
  text-align: center;
  margin-bottom: 36px;
  font-weight: 500;
}

.schools-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
}

.school-hex-card-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 270px;
}

@media (max-width: 700px) {
  .schools-cards-grid {
    gap: 14px;
  }
  .school-hex-card-stack {
    width: 92vw;
    max-width: 310px;
  }
}

/* Title outside the flip hex card */
.school-hex-title {
  margin-top: 14px;
  font-size: 1.13rem;
  font-weight: 700;
  color: #0d3a80;
  text-align: center;
  letter-spacing: .03em;
  padding: 4px 2px 0 2px;
}

/* Flip Card Container */
.school-hex-card-container {
  perspective: 1200px;
  width: 270px;
  height: 310px;
}

@media (max-width: 700px) {
  .school-hex-card-container {
    height: 260px;
  }
}

/* Flip card wrapper */
.school-hex-flip-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.41,.69,.46,1.04);
}

.school-hex-flip-card.flipped,
.school-hex-card-container:hover .school-hex-flip-card,
.school-hex-card-container:focus-within .school-hex-flip-card {
  transform: rotateY(180deg);
}

/* Three thickness layered octagon borders */
.border-outer,
.border-middle,
.border-inner {
  width: 100%;
  height: 100%;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  box-sizing: border-box;
}

.border-outer {
  background: linear-gradient(120deg, #092c5c 60%, #093877 100%);
  padding: 7px;
  z-index: 1;
}

.border-middle {
  background: linear-gradient(90deg, #fff7e1 90%, #d3e4fc 100%);
  padding: 5px;
}

.border-inner {
  background: #092c5c;
  padding: 4px;
}

/* Card faces */
.school-hex-card-front,
.school-hex-card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(168, 92, 249, 0.09);
  overflow: hidden;
  backface-visibility: hidden;
  z-index: 1;
}

.school-hex-card-front {
  z-index: 2;
}

.school-hex-card-back {
  transform: rotateY(180deg);
  color: #0d3a80;
  padding: 32px 18px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 28px #a85cf913;
}

/* Front image with shine */
.school-hex-img-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}

.school-hex-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1.04) contrast(1.04);
  transition: filter 0.24s;
}

.school-hex-card-container:hover .school-hex-img {
  filter: brightness(1.09) contrast(1.15);
}

.school-hex-shine {
  position: absolute;
  top: 0;
  left: -70%;
  width: 30%;
  height: 100%;
  background: linear-gradient(120deg,rgba(255,255,255,0.03) 5%,rgba(255,255,255,0.62) 50%,rgba(255,255,255,0.09) 77%);
  transform: skewX(-22deg);
  transition: left 0.58s cubic-bezier(.64,0,.28,1);
  pointer-events: none;
}

.school-hex-card-container:hover .school-hex-shine,
.school-hex-flip-card.flipped .school-hex-shine {
  left: 100%;
}

/* Back content styling */
.school-hex-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.school-hex-info p {
  margin: 6px 0;
  font-size: 1rem;
  color: #444;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.school-hex-info p:nth-of-type(1) {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0d3a80;
}

.school-hex-info p:nth-of-type(2) {
  font-style: italic;
  color: #6a6a6a;
  font-weight: 600;
  margin-top: 4px;
}

.school-hex-info p:nth-of-type(3) {
  font-weight: 700;
  color: #a85cf9;
  font-size: 1.05rem;
  margin-top: 4px;
}
