/* Base section styles */
.cc-section {
  background: var(--bg);
  padding: 30px 0;
  transition: background 0.3s ease;
  position: relative;
  overflow: visible;
}

/* Full width support for extended rows */
.cc-section-full-width {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
}

/* Hover effect for section background */
.cc-section:hover {
  background: var(--bg-hover);
}

/* Title styles */
.cc-title {
  text-align: center;
  margin-bottom: 20px;
  transition: color 0.3s ease;
  /* Font styles will be applied inline via PHP */
}

.cc-section:hover .cc-title {
  color: var(--title-hover);
}

/* Container for content */
.cc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Row and column layout */
.cc-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.cc-col {
  flex: 1;
  perspective: 1000px;
  min-width: 280px;
  max-width: 400px;
}

/* Hover box styles */
.cc-hover-box {
  width: 100%;
  min-height: 250px;
  height: auto;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer; /* Hand cursor */
}

.cc-hover-box:hover {
  transform: rotateY(180deg);
}

/* Front and back sides */
.cc-hover-box .cc-front,
.cc-hover-box .cc-back {
  position: absolute;
  width: 100%;
  min-height: 250px;
  height: auto;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: visible;
  word-wrap: break-word;
  /* Font styles will be applied inline via PHP */
}

/* Ensure content doesn't overflow */
.cc-hover-box .cc-front > *,
.cc-hover-box .cc-back > * {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cc-hover-box .cc-back {
  transform: rotateY(180deg);
}

/* Image/icon styles */
.cc-hover-box img {
  max-width: 60px;
  max-height: 60px;
  margin-bottom: 15px;
  object-fit: contain;
}

/* Text styles */
.cc-hover-box p {
  margin: 0;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  /* Font styles will be applied inline via PHP */
}

/* Source text specific styles */
.cc-hover-box .cc-back-source {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  opacity: 0.8 !important;
  font-style: italic !important;
  line-height: 1.4 !important;
}

/* Ensure main text has proper spacing when source is present */
.cc-hover-box .cc-back-text {
  margin-bottom: 5px !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .cc-row {
    flex-direction: column;
    align-items: center;
  }
  
  .cc-col {
    max-width: 100%;
    margin-bottom: 20px;
  }
  
  .cc-section {
    padding: 20px 0;
  }
  
  .cc-container {
    padding: 0 10px;
  }
  
  .cc-hover-box {
    min-height: 200px;
  }
  
  .cc-hover-box .cc-front,
  .cc-hover-box .cc-back {
    min-height: 200px;
  }
}

@media (max-width: 480px) {
  .cc-hover-box {
    min-height: 180px;
  }
  
  .cc-hover-box .cc-front,
  .cc-hover-box .cc-back {
    min-height: 180px;
    padding: 15px;
  }
  
  .cc-hover-box img {
    max-width: 40px;
    max-height: 40px;
    margin-bottom: 10px;
  }
}