/**
 * SG Homepage CMS Module - Frontend Styles
 * @author Seldom Group
 * Updated version with unified typography and vertical alignment
 */

/* Text Alignment Classes */
.sg-align-left {
  text-align: left !important;
}

.sg-align-center {
  text-align: center !important;
}

.sg-align-right {
  text-align: right !important;
}

.sg-align-justify {
  text-align: justify !important;
}

/* Vertical Alignment Classes */
.sg-vertical-top .sg-homepage-cms-text-content {
  justify-content: flex-start !important;
}

.sg-vertical-center .sg-homepage-cms-text-content {
  justify-content: center !important;
}

.sg-vertical-bottom .sg-homepage-cms-text-content {
  justify-content: flex-end !important;
}

/* Main Section */
.sg-homepage-cms-section {
  padding: 100px 0 120px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
  min-height: 80vh;
}

.sg-homepage-cms-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(184, 132, 82, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(184, 132, 82, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.sg-homepage-cms-row {
  align-items: stretch; /* Make columns equal height */
  min-height: 70vh;
  position: relative;
  z-index: 2;
  display: flex;
}

/* Text Column with Vertical Alignment */
.sg-homepage-cms-text-column {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Horizontal centering for content */
  justify-content: center; /* Default vertical center, overridden by vertical classes */
  /* min-height removed - will stretch to match image column */
}

.sg-homepage-cms-text-content {
  width: 100%;
  max-width: 700px;
  position: relative;
  flex: 1; /* Take all available height in parent flex container */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Default center, overridden by vertical alignment classes */
}

/* Unified Typography - Title and Subtitle Same Size */
.sg-homepage-cms-title,
.sg-homepage-cms-subtitle {
  font-size: 42px;
  font-weight: 400;
  color: #b2aba2;
  margin-bottom: 10px;
  line-height: 1.2;
  font-family: 'Nunito', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  position: relative;
}

/* Remove the decorative line from title */
.sg-homepage-cms-title::after {
  display: none;
}

/* Subtitle specific styling - same as title but different color for distinction */
.sg-homepage-cms-subtitle {
  margin-bottom: 35px;
  margin-bottom: 55px;
}

.sg-homepage-cms-content {
  font-size: 1.3rem;
  line-height: 1.8;
  color: #4a5568;
  font-family: 'Nunito', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
}

.sg-homepage-cms-content p {
  font-size: 18px;
  color: #000000;
  font-weight: 400;
  line-height: 30px;
  margin-bottom: 25px;
  margin-bottom: 5px;
}

.homepage-but {
  border-radius: 0px !important;
  background-color: #000000!important;
  border: 1px solid #000000!important;
  color: white;
  padding: 22px 53px !important;
  font-size: 20px;
  padding: 30px 100px !important;
  font-size: 16px;
  text-transform: uppercase;
  font-weight: 300;
}

.homepage-but:hover {
  border-radius: 0px !important;
  color: #B88452;
  color: #000000;
  background-color: #b4aaa0 !important;
}

.homepage-but:focus {
  border-radius: 0px !important;
  color: #B88452;
  outline: none;
}

.sg-homepage-cms-content p:last-child {
  margin-bottom: 0;
  margin-top: 50px;
}

/* Image Column - Unchanged */
.sg-homepage-cms-image-column {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Image height will determine column height */
}

.sg-homepage-cms-image-wrapper {
  width: 100%;
  max-width: 700px;
  position: relative;
  overflow: hidden;
  border-radius: 0px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sg-homepage-cms-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(184, 132, 82, 0.1) 0%, transparent 50%);
  z-index: 1;
  border-radius: 0px;
  transition: opacity 0.4s ease;
}

.sg-homepage-cms-image-wrapper:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 
    0 35px 70px rgba(0, 0, 0, 0.2),
    0 15px 30px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sg-homepage-cms-image-wrapper:hover::before {
  opacity: 0.7;
}

.sg-homepage-cms-image {
  width: 100%;
  height: auto;
  min-height: 500px;
  object-fit: cover;
  display: block;
  border-radius: 0px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 2;
}

.sg-homepage-cms-image-wrapper:hover .sg-homepage-cms-image {
  transform: scale(1.05);
}

/* Responsive Design */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
  .sg-homepage-cms-section {
    padding: 120px 0 140px;
    min-height: 90vh;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 48px;
  }
  
  .sg-homepage-cms-content {
    font-size: 1.4rem;
  }

  .sg-homepage-cms-image {
    min-height: 600px;
  }
}

/* Desktop (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .sg-homepage-cms-section {
    padding: 100px 0 120px;
    min-height: 80vh;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 44px;
  }
  
  .sg-homepage-cms-text-column,
  .sg-homepage-cms-image-column {
    padding: 35px;
  }
  
  .sg-homepage-cms-text-column {
    flex-direction: column;
  }

  .sg-homepage-cms-image {
    min-height: 450px;
  }
}

/* Medium Desktop (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .sg-homepage-cms-section {
    padding: 80px 0 100px;
    min-height: 70vh;
  }
  
  .sg-homepage-cms-row {
    min-height: 60vh;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 40px;
    margin-bottom: 25px;
  }
  
  .sg-homepage-cms-content {
    font-size: 1.2rem;
  }
  
  .sg-homepage-cms-text-column,
  .sg-homepage-cms-image-column {
    padding: 30px;
  }
  
  .sg-homepage-cms-text-column {
    flex-direction: column;
  }

  .sg-homepage-cms-image {
    min-height: 400px;
  }
}

/* Tablet (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .sg-homepage-cms-section {
    padding: 60px 0 80px;
    min-height: 60vh;
  }
  
  .sg-homepage-cms-row {
    min-height: 50vh;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 36px;
    margin-bottom: 20px;
  }
  
  .sg-homepage-cms-content {
    font-size: 1.1rem;
    line-height: 1.7;
  }
  
  .sg-homepage-cms-text-column,
  .sg-homepage-cms-image-column {
    padding: 25px;
  }
  
  .sg-homepage-cms-text-column {
    flex-direction: column;
  }

  .sg-homepage-cms-image {
    min-height: 350px;
  }

  .sg-homepage-cms-image-wrapper {
    max-width: 500px;
  }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
  .sg-homepage-cms-section {
    padding: 50px 0 60px;
    min-height: auto;
  }
  
  .sg-homepage-cms-row {
    min-height: auto;
    flex-direction: column;
  }
  
  .sg-homepage-cms-text-column {
    order: 1;
    padding: 30px 20px 40px;
    text-align: center;
    min-height: auto;
    flex-direction: column;
  }
  
  .sg-homepage-cms-image-column {
    order: 2;
    padding: 0 20px 30px;
    min-height: auto;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 32px;
    margin-bottom: 18px;
    text-align: center;
  }
  
  .sg-homepage-cms-content {
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.6;
  }
  
  .sg-homepage-cms-text-content {
    max-width: 100%;
  }
  
  .sg-homepage-cms-image-wrapper {
    max-width: 450px;
    margin: 0 auto;
  }

  .sg-homepage-cms-image {
    min-height: 300px;
  }

  /* Force center alignment on mobile for better UX */
  .sg-align-left,
  .sg-align-right,
  .sg-align-justify {
    text-align: center !important;
  }
}

/* Extra Small Mobile (up to 480px) */
@media (max-width: 480px) {
  .sg-homepage-cms-section {
    padding: 40px 0 50px;
  }
  
  .sg-homepage-cms-title,
  .sg-homepage-cms-subtitle {
    font-size: 28px;
    margin-bottom: 15px;
  }
  
  .sg-homepage-cms-content {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .sg-homepage-cms-text-column {
    padding: 25px 15px 35px;
    flex-direction: column;
  }
  
  .sg-homepage-cms-image-column {
    padding: 0 15px 25px;
  }
  
  .sg-homepage-cms-image-wrapper {
    max-width: 350px;
    border-radius: 0px;
  }
  
  .sg-homepage-cms-image {
    border-radius: 0px;
    min-height: 250px;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .sg-homepage-cms-image-wrapper,
  .sg-homepage-cms-image,
  .sg-homepage-cms-image-wrapper::before {
    transition: none !important;
  }
  
  .sg-homepage-cms-image-wrapper:hover {
    transform: none !important;
  }
  
  .sg-homepage-cms-image-wrapper:hover .sg-homepage-cms-image {
    transform: none !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .sg-homepage-cms-title {
    color: #000000;
  }
  
  .sg-homepage-cms-subtitle {
    color: #333333;
  }
  
  .sg-homepage-cms-content {
    color: #000000;
  }
  
  .sg-homepage-cms-image-wrapper {
    border: 2px solid #000000;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .sg-homepage-cms-section {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  }
  
  .sg-homepage-cms-title {
    color: #f7fafc;
  }
  
  .sg-homepage-cms-subtitle {
    color: #B88452;
  }
  
  .sg-homepage-cms-content {
    color: #e2e8f0;
  }
}

/* Focus states for accessibility */
.sg-homepage-cms-image:focus {
  outline: 3px solid #B88452;
  outline-offset: 3px;
}

/* Print styles */
@media print {
  .sg-homepage-cms-section {
    padding: 20px 0;
    background: transparent !important;
    min-height: auto;
  }
  
  .sg-homepage-cms-section::before {
    display: none;
  }
  
  .sg-homepage-cms-image-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .sg-homepage-cms-row {
    min-height: auto;
  }
  
  .sg-homepage-cms-text-column,
  .sg-homepage-cms-image-column {
    min-height: auto;
  }

  .sg-homepage-cms-image {
    min-height: auto;
  }
}