/**
 * CTA Styles
 * Styles for various call-to-action components
 *
 * @package LeanPress
 *
 * TABLE OF CONTENTS:
 * 1. Common CTA Properties
 * 2. Product Recommendation CTA
 * 3. Service CTA
 * 4. Cheatsheet Signup CTA
 * 5. Hosting CTA
 * 6. Global CTA
 */

/* 1. Common CTA Properties */
:root {
    --cta-border-radius: 10px;
    --cta-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --cta-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --cta-padding: 1.5rem;
    --cta-transition: 0.5s ease;
    --cta-button-transition: 0.2s ease;
    --cta-bg-opacity: 0.95;
    --cta-border-opacity: 0.3;
}

/* 2. Product Recommendation CTA Styles */
.product-cta-wrapper {
    margin: 2rem 0;
    width: 100%;
}

.product-cta {
    background-color: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: var(--cta-border-radius);
    box-shadow: var(--cta-shadow);
    overflow: hidden;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.product-cta:hover {
    box-shadow: var(--cta-hover-shadow);
}

.product-cta__container {
    display: flex;
    flex-direction: row-reverse; /* Reverse the order to put image on right */
    align-items: center;
    gap: 1.5rem;
}

.product-cta__image {
    flex: 0 0 30%;
    max-width: 30%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-cta__image-element {
    max-width: 100%;
    max-height: 250px;
    height: auto;
    margin: 0 auto;
}

.product-cta__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-cta__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--c-fg);
}

.product-cta__description {
    font-size: clamp(1.08rem, 3vw, 1.13rem);
    font-weight: 370;
    line-height: 1.6;
    margin: 0;
    color: var(--c-fg);
}

.product-cta__button-container {
    margin-top: 0.5rem;
}

/* Button styles now use the unified button system in main.css */

.product-cta__disclaimer {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

/* Product CTA - Full Content */
.product-cta__full-content-wrapper {
    width: 100%;
    clear: both;
    box-sizing: border-box;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 3. Common Grid-Based CTA Styles */
.service-cta-wrapper,
.hosting-cta-wrapper {
    margin: 2rem 0;
    width: 100%;
}

/* Common CTA container styles */
.service-cta,
.hosting-cta {
    background-color: var(--c-accent); /* Light green background */
    border: 1px solid var(--c-accent); /* Light green border */
    border-radius: var(--cta-border-radius);
    box-shadow: var(--cta-shadow);
    overflow: hidden;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.service-cta:hover,
.hosting-cta:hover {
    box-shadow: var(--cta-hover-shadow);
}

/* Common grid layout for CTAs */
.service-cta__inner,
.hosting-cta__inner,
.cheatsheet-signup__inner,
.global-cta__inner {
    display: grid;
    grid-template-columns: 20% 80%; /* Icon/image column and content column */
    grid-template-areas: "image content";
    align-items: center;
    gap: 1.75rem;
}

/* Common content area styles */
.service-cta__content,
.hosting-cta__content,
.cheatsheet-signup__content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 1.75rem;
}

/* Common title styles */
.service-cta__title,
.hosting-cta__title {
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    font-weight: 700;
    margin: 0;
    color: var(--c-fg); 
}

/* Common description styles */
.service-cta__description,
.hosting-cta__description {
    font-size: clamp(1.08rem, 3vw, 1.13rem);
    line-height: 1.6;
    margin: 0;
    color: var(--c-fg);
    font-weight: 450;
}

/* Common button container styles */
.service-cta__button-container,
.hosting-cta__button-container {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* Common icon/image container styles */
.service-cta__icon-container,
.hosting-cta__icon-container,
.global-cta__icon-container,
.cheatsheet-signup__icon-container {
    grid-area: image;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cheatsheet-signup__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

/* Common image/icon container styles */
.service-cta__image-container,
.service-cta__icon-container,
.hosting-cta__image-container,
.hosting-cta__icon-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Common image styles */
.service-cta__image,
.hosting-cta__image {
    max-width: 150px;
    height: auto;
    display: block;
    border-radius: 50%;
    margin: 0 auto;
}

/* Common icon styles */
.service-cta__icon,
.hosting-cta__icon {
    width: 130px;
    height: 130px;
    display: block;
    margin: 0 auto;
}

/* Larger cheatsheet icon */
.cheatsheet-signup__icon {
    width: 180px; /* Increased size */
    height: 180px; /* Explicit height for Lighthouse */
    display: block;
    margin: 0 auto;
    max-width: none; /* Override any max-width constraints */
    object-fit: contain; /* Ensure image maintains aspect ratio within fixed dimensions */
}

/* Common responsive adjustments */
/* Medium breakpoint for tablets */
@media (max-width: 992px) and (min-width: 768px) {
    .service-cta__inner,
    .hosting-cta__inner,
    .cheatsheet-signup__inner,
    .global-cta__inner {
        grid-template-columns: 20% 80%; /* Adjusted ratio for medium screens */
        gap: 1.5rem;
    }
    
    .service-cta__icon,
    .hosting-cta__icon,
    .cheatsheet-signup__icon,
    .global-cta__icon {
        width: 140px; /* Slightly larger than mobile, smaller than desktop */
        height: 140px;
    }
    
    .service-cta__content,
    .hosting-cta__content,
    .cheatsheet-signup__content,
    .global-cta__content {
        padding-right: 1rem; /* Reduced padding on medium screens */
    }
    
    .service-cta__title,
    .hosting-cta__title,
    .cheatsheet-signup__title,
    .global-cta__title {
        font-size: clamp(1.2rem, 1.8vw, 1.4rem); /* Slightly smaller than desktop */
    }
}

/* Mobile breakpoint */
@media (max-width: 767px) {
    .service-cta__inner,
    .hosting-cta__inner,
    .cheatsheet-signup__inner,
    .global-cta__inner {
        grid-template-columns: 1fr; /* Single column on mobile */
        grid-template-areas:
            "image"
            "content";
        gap: 1.5rem;
        text-align: center;
    }
    
    .service-cta__image-container,
    .service-cta__icon-container,
    .hosting-cta__image-container,
    .hosting-cta__icon-container,
    .cheatsheet-signup__icon-container,
    .global-cta__icon-container {
        margin-top: 0;
        grid-row: 1; /* Move image to top on mobile */
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .service-cta__icon,
    .hosting-cta__icon,
    .cheatsheet-signup__icon,
    .global-cta__icon {
        width: 120px;
        height: 120px;
        display: block;
        margin: 0 auto;
    }
    
    .service-cta__content,
    .hosting-cta__content,
    .cheatsheet-signup__content,
    .global-cta__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-right: 0; /* Remove right padding at mobile breakpoint */
    }
    
    .service-cta__title,
    .service-cta__description,
    .hosting-cta__title,
    .hosting-cta__description,
    .cheatsheet-signup__title,
    .cheatsheet-signup__description,
    .global-cta__title,
    .global-cta__description {
        text-align: center;
    }
    
    .service-cta__button-container,
    .hosting-cta__button-container,
    .global-cta__button-container {
        display: flex;
        justify-content: center;
    }
}

.product-cta__full-content {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.product-cta__full-content {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.product-cta__full-content h4 {
    margin-top: 0;
    color: var(--c-text-dark, #000);
}

.product-cta__full-content h5 {
    color: var(--c-text-dark, #000);
    margin-bottom: 0.5rem;
}

.product-cta__full-content img {
    max-width: 100%;
    height: auto;
}

.product-cta__full-content ul.is-style-check {
    list-style: none;
    padding-left: 1.5rem;
}

.product-cta__full-content ul.is-style-check li {
    position: relative;
    margin-bottom: 0.5rem;
}

.product-cta__full-content ul.is-style-check li:before {
    content: '✓';
    position: absolute;
    left: -1.5rem;
    color: var(--c-primary, #7CF2A5);
    font-weight: bold;
}

.product-cta__full-content .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.product-cta__full-content .wp-block-column {
    flex: 1 0 200px;
}

.product-cta__full-content blockquote {
    border-left: 4px solid var(--c-primary, #7CF2A5);
    padding-left: 1rem;
    font-style: italic;
    margin-left: 0;
    color: var(--c-text-gray, #555);
}

.product-cta__full-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: bold;
}

/* Product CTA Mobile Responsive Styles */
@media (max-width: 767px) {
    .product-cta__container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .product-cta__image {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .product-cta__image-element {
        margin: 0 auto;
    }
    
    .product-cta__title {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .product-cta__description {
        text-align: center;
    }
    
    .product-cta__button-container {
        text-align: center;
    }
    
    .product-cta__disclaimer {
        text-align: center;
    }
}

/* 4. Cheatsheet Signup CTA */
.cheatsheet-signup {
  /* Using theme text color variable */
  color: var(--c-fg);
  background-color: rgba(0, 0, 0);
  padding: 1.5rem 2rem 1.75rem;
  margin: 2rem 0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Note: Most cheatsheet CTA layout styles are shared in the common section above */

.cheatsheet-signup__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.cheatsheet-signup__content {
  padding-right: 2.5rem; /* Specific padding for content */
}

.cheatsheet-signup__title {
  color: var(--c-bg);
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  font-weight: 700;
  margin: 0.5rem 0 0;
}

.cheatsheet-signup__emphasis {
  color: var(--c-accent);
  font-weight: 800;
  font-style: italic;
}

.cheatsheet-signup__description {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1.08rem, 3vw, 1.15rem);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

/* Cheatsheet CTA Mobile Responsive Styles */
@media (max-width: 767px) {
  .cheatsheet-signup__inner {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "icon"
      "content";
    gap: 1rem;
  }
  
  .cheatsheet-signup__icon-container {
    grid-area: icon;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .cheatsheet-signup__icon {
    width: 120px;
    height: 120px;
  }
  
  .cheatsheet-signup__content {
    text-align: center;
    padding-right: 0; /* Remove right padding at mobile breakpoint */
  }
  
  .cheatsheet-signup__title {
    text-align: center;
  }
  
  .cheatsheet-signup__description {
    text-align: center;
  }
}

/* 5. Hosting CTA Styles */
/* Note: Most hosting CTA styles are now shared with service CTA in the common section above */

/* Specific overrides for hosting CTA */
.hosting-cta__image {
    max-width: 130px; /* Slightly smaller than service CTA images */
}

/* CTA Button Styles */
.service-cta .btn,
.hosting-cta .btn,
.global-cta .btn {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border-color: #000000 !important;
    text-decoration: none !important;
    padding: 0.4rem 1.5rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease;
}

.service-cta .btn:hover,
.hosting-cta .btn:hover,
.global-cta .btn:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
    text-decoration: none !important;
}

/* CTA button specific styles */
.cheatsheet-signup-button {
    padding: 0.6rem 1.5rem !important;
}

/* 5. Cheatsheet Signup CTA */
/* Uses consistent styling for all CTAs */

/* Text link styles */
.cta-text-link {
    color: var(--c-fg);
    font-size: 0.95rem;
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.5rem;
}

.cta-text-link:hover {
    color: var(--button-on-green-bg);
}

.cta-text-link:hover .link-text {
    text-decoration: underline;
}

/* Mobile adjustments for text links */
@media (max-width: 767px) {
    .service-cta__button-container,
    .hosting-cta__button-container {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .cta-text-link {
        margin-top: 0.25rem;
    }
}

/* 6. Global CTA Component */
.global-cta {
  background-color: var(--c-accent);
  color: var(--c-fg);
  border-radius: 8px;
  padding: 1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 3rem;
}

/* Note: Most global CTA layout styles are now shared in the common section above */

.global-cta__inner {
  display: grid;
  grid-template-columns: 15% 85%; /* Slimmer and more space-efficient layout */
  grid-template-areas: "image content";
  gap: 2rem; /* Increased gap between grid areas for better visual separation */
  position: relative;
  z-index: 1;
}

.global-cta__icon-container {
  grid-area: image;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-cta__icon {
  width: 150px; /* Increased icon dimensions for better visibility */
  height: 160px;
  display: block;
  margin: 0 auto;
}

.global-cta__content {
  grid-area: content;
  padding-right: 2rem; /* Added proper spacing with right padding on the button container */
}

.global-cta__text-button-wrapper {
  display: flex;
  align-items: center;
  padding-bottom: 1rem; /* Added padding-bottom to the text-button wrapper for better spacing */
  gap: 3rem; /* Increased gap between text and button for better visual separation */
}

.global-cta h2 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin: 0.75rem 0;
  color: var(--c-fg);
  text-align: left;
}

.global-cta p {
    margin-bottom: 0;
    color: var(--c-fg, #1F1F1F);
    font-size: clamp(1.1rem, 2vw, 1.15rem);
    text-align: left;
    flex: 1;
    font-weight: 500;
}

.global-cta__button-container {
  text-align: left;
  padding-right: 1rem;
}


/* Global CTA Medium Screen Responsive Styles (992px-769px) */
@media (max-width: 992px) and (min-width: 769px) {
  .global-cta__inner {
    grid-template-columns: 20% 80%;
    grid-template-areas: "image content";
  }
  
  .global-cta__icon {
    width: 140px; /* Adjusted icon size at medium breakpoint to prevent squishing */
    height: 150px;
  }
  
  .global-cta__text-button-wrapper {
    gap: 2rem;
  }
}

/* Global CTA Mobile Responsive Styles */
@media (max-width: 768px) {
  .global-cta__inner {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "image"
      "content";
    gap: 1rem;
  }
  
  .global-cta__content {
    text-align: center;
    padding-right: 0;
  }
  
  .global-cta h2 {
    text-align: center;
  }
  
  .global-cta__text-button-wrapper {
    flex-direction: column;
    gap: 1rem;
  }
  
  .global-cta p {
    text-align: center;
    margin-bottom: 0;
  }
  
  .global-cta__button-container {
    text-align: center;
    padding-right: 0;
  }
}

/* Footer CTA Spacer */
.footer-cta-spacer {
  height: 2rem;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  
}

@media (max-width: 768px) {
  :root {
    --site-padding: 0.75rem;
  }

  /* Service cards responsive styles */
  .services-section__grid {
    grid-template-columns: 1fr;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  /* Newsletter styles removed */
}

@media (max-width: 480px) {
  .cheatsheet-signup {
    padding: 1.5rem 1rem 2rem;
  }
}
