/**
 * ZapFlab Design Polish
 * Drop this into WordPress Customizer > Additional CSS
 * or enqueue as a custom stylesheet
 * 
 * Fixes AI-generated design tells and adds professional polish
 */

/* ==========================================================================
   0. TYPOGRAPHY OVERRIDES (disable fluid typography issues)
   ========================================================================== */

/* Fix WordPress fluid typography making headings and text tiny/jumbled */
.wp-block-column h3.wp-block-heading,
.wp-block-column h3 {
  font-size: 1.2rem !important;
  min-height: auto !important;
}

.wp-block-column h4.wp-block-heading,
.wp-block-column h4 {
  font-size: 1rem !important;
}

/* Force readable text sizes in columns */
.wp-block-column p,
.wp-block-column li {
  font-size: 0.95rem !important;
}

.wp-block-column ul.wp-block-list {
  font-size: 0.95rem !important;
  line-height: 1.9 !important;
}

/* ==========================================================================
   1. GLOBAL REFINEMENTS
   ========================================================================== */

/* Tighter, more professional button radius */
.wp-block-button__link,
.wp-element-button {
  border-radius: 6px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wp-block-button__link:active,
.wp-element-button:active {
  transform: translateY(0);
}

/* Improve heading contrast */
h1, h2, h3 {
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
}

/* Subtle texture on light sections */
.has-base-background-color {
  position: relative;
}

.has-base-background-color::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ==========================================================================
   2. "EVERYTHING YOU NEED" SECTION - Feature Cards
   ========================================================================== */

/* Base card improvements */
.has-accent-5-background-color.wp-block-column {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px !important;
  overflow: hidden;
}

/* Hover lift effect */
.has-accent-5-background-color.wp-block-column:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Add accent border to first card - homepage only */
.page-id-5 .wp-container-core-columns-is-layout-cbe57604 .wp-block-column:first-child {
  border-top: 3px solid #FFE135;
}

/* Subtle gradient variation on second card - homepage only */
.page-id-5 .wp-container-core-columns-is-layout-cbe57604 .wp-block-column:nth-child(2) {
  background: linear-gradient(180deg, #FBFAF3 0%, #F5F4ED 100%) !important;
}

/* Third card - subtle pattern - homepage only */
.page-id-5 .wp-container-core-columns-is-layout-cbe57604 .wp-block-column:nth-child(3) {
  background: 
    radial-gradient(circle at 100% 0%, rgba(255, 225, 53, 0.08) 0%, transparent 50%),
    #FBFAF3 !important;
}

/* Replace emoji with styled icon containers */
/* Icon containers - ONLY for homepage feature cards, not other pages */
.page-id-5 .wp-container-core-columns-is-layout-cbe57604 .wp-block-column h3:first-of-type:not(.has-text-align-center) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #111111 0%, #2a2a2a 100%);
  border-radius: 14px;
  margin-bottom: 16px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 1.5rem !important;
}

/* ==========================================================================
   3. GLP-1 SCIENCE SECTION
   ========================================================================== */

/* Image treatment */
.wp-container-core-columns-is-layout-f5a44f5b figure img {
  border-radius: 12px !important;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wp-container-core-columns-is-layout-f5a44f5b figure:hover img {
  transform: scale(1.02);
}

/* Add a subtle frame effect */
.wp-container-core-columns-is-layout-f5a44f5b figure {
  position: relative;
}

.wp-container-core-columns-is-layout-f5a44f5b figure::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 225, 53, 0.3);
  border-radius: 8px;
  pointer-events: none;
  transition: all 0.3s ease;
}

.wp-container-core-columns-is-layout-f5a44f5b figure:hover::after {
  inset: 8px;
  border-color: rgba(255, 225, 53, 0.5);
}

/* ==========================================================================
   4. FREE TOOLS SECTION - Tool Cards Grid
   ========================================================================== */

/* Fix tool card description text - make it readable on dark bg */
.has-contrast-background-color .wp-block-group[style*="border-color:#ffffff15"] p {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Ensure all text in dark tool cards is visible */
[style*="background-color:#ffffff08"] p,
[style*="background-color:#ffffff08"] .has-text-color {
  color: rgba(255, 255, 255, 0.7) !important;
}

[style*="background-color:#ffffff08"] h3 {
  color: #ffffff !important;
}

[style*="background-color:#ffffff08"] a {
  color: #FFE135 !important;
}

/* Tool card base styles */
.wp-container-core-group-is-layout-89ee920e .wp-block-group {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px !important;
  overflow: hidden;
}

/* Staggered hover effects */
.wp-container-core-group-is-layout-89ee920e .wp-block-group:hover {
  transform: translateY(-4px);
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 225, 53, 0.3) !important;
}

/* First card - featured style */
.wp-container-core-group-is-layout-89ee920e .wp-block-group:first-child {
  background: linear-gradient(135deg, rgba(255, 225, 53, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
  border-color: rgba(255, 225, 53, 0.25) !important;
}

/* Add "POPULAR" badge to first tool */
.wp-container-core-group-is-layout-89ee920e .wp-block-group:first-child::before {
  content: "POPULAR";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #FFE135;
  color: #111;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Style the emoji icons in tool cards */
.wp-container-core-group-is-layout-89ee920e .wp-block-group > p:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 225, 53, 0.15);
  border-radius: 10px;
  margin-bottom: 12px !important;
}

/* Link hover effect */
.wp-container-core-group-is-layout-89ee920e a {
  position: relative;
  transition: all 0.2s ease;
}

.wp-container-core-group-is-layout-89ee920e a:hover {
  padding-left: 4px;
}

/* ==========================================================================
   5. OPTAVIA DECODED SECTION
   ========================================================================== */

/* Add visual interest to the Optavia section */
.wp-container-core-group-is-layout-ee4a3eba {
  position: relative;
}

.wp-container-core-group-is-layout-ee4a3eba::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 225, 53, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ==========================================================================
   6. CTA SECTION - "Start Your Journey"
   ========================================================================== */

/* Enhanced CTA background with glow effects */
.wp-block-cover.alignfull:has(.wp-block-button) {
  position: relative;
  overflow: hidden;
}

.wp-block-cover.alignfull:has(.wp-block-button)::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255, 225, 53, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(155, 111, 217, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
  animation: ctaGlow 8s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5%, -5%) rotate(3deg); }
}

/* Subtle grid pattern overlay */
.wp-block-cover.alignfull:has(.wp-block-button)::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Make the CTA button pop more */
.wp-container-core-buttons-is-layout-71d2ff36 .wp-block-button__link {
  position: relative;
  overflow: hidden;
}

.wp-container-core-buttons-is-layout-71d2ff36 .wp-block-button__link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.wp-container-core-buttons-is-layout-71d2ff36 .wp-block-button__link:hover::before {
  left: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .wp-block-cover.alignfull:has(.wp-block-button)::before {
    animation: none;
  }
}

/* ==========================================================================
   7. FOOTER REFINEMENTS
   ========================================================================== */

/* Subtle top border on footer */
.wp-container-core-group-is-layout-23789785 {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Social links hover */
.wp-block-social-links .wp-social-link {
  transition: all 0.2s ease !important;
}

.wp-block-social-links .wp-social-link:hover {
  transform: translateY(-2px) scale(1.1) !important;
}

/* ==========================================================================
   8. SCROLL ANIMATIONS (optional - adds entrance effects)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  /* Fade in cards on scroll */
  .has-accent-5-background-color.wp-block-column,
  .wp-container-core-group-is-layout-89ee920e .wp-block-group {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
  }
  
  .has-accent-5-background-color.wp-block-column:nth-child(1),
  .wp-container-core-group-is-layout-89ee920e .wp-block-group:nth-child(1) {
    animation-delay: 0.1s;
  }
  
  .has-accent-5-background-color.wp-block-column:nth-child(2),
  .wp-container-core-group-is-layout-89ee920e .wp-block-group:nth-child(2) {
    animation-delay: 0.2s;
  }
  
  .has-accent-5-background-color.wp-block-column:nth-child(3),
  .wp-container-core-group-is-layout-89ee920e .wp-block-group:nth-child(3) {
    animation-delay: 0.3s;
  }
  
  .wp-container-core-group-is-layout-89ee920e .wp-block-group:nth-child(4) {
    animation-delay: 0.4s;
  }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ==========================================================================
   9. RESPONSIVE POLISH
   ========================================================================== */

@media (max-width: 781px) {
  /* Reduce hover effects on mobile (touch) */
  .has-accent-5-background-color.wp-block-column:hover,
  .wp-container-core-group-is-layout-89ee920e .wp-block-group:hover {
    transform: none;
  }
  
  /* Ensure cards stack nicely */
  .has-accent-5-background-color.wp-block-column {
    margin-bottom: 16px;
  }
  
  /* Tighter padding on mobile */
  .wp-container-core-group-is-layout-89ee920e .wp-block-group {
    padding: 20px !important;
  }
}

/* ==========================================================================
   10. DARK SECTION ENHANCEMENTS
   ========================================================================== */

/* Add depth to dark sections */
.has-contrast-background-color {
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(255, 225, 53, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 225, 53, 0.02) 0%, transparent 50%),
    #111111 !important;
}

/* Improve text rendering on dark backgrounds */
.has-contrast-background-color,
.has-contrast-background-color * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   11. FOOTER FIXES
   ========================================================================== */

/* Remove gap/margin above footer */
.wp-block-template-part,
footer.wp-block-template-part,
.wp-site-blocks > .wp-block-template-part:last-child {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
}

/* Also target the main content wrapper */
.wp-site-blocks > *:last-child {
  margin-bottom: 0 !important;
}

/* Remove underlines from footer links */
footer a,
.wp-block-template-part[data-slug="footer"] a,
.wp-block-template-part a,
footer .wp-block-navigation a,
footer .wp-block-navigation-link a {
  text-decoration: none !important;
}

footer a:hover,
.wp-block-template-part a:hover {
  text-decoration: none !important;
  opacity: 0.8;
}

/* Remove bullets from footer lists */
footer ul,
footer li,
.wp-block-template-part ul,
.wp-block-template-part li {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

footer ul {
  padding: 0 !important;
  margin: 0 !important;
}

/* Make category cards clickable */
.wp-block-column.has-accent-5-background-color {
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.wp-block-column.has-accent-5-background-color:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

/* Make tool cards fully clickable */
.wp-block-group-is-layout-grid > .wp-block-group {
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.wp-block-group-is-layout-grid > .wp-block-group:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 225, 53, 0.4) !important;
  transform: translateY(-2px);
}

/* Stretch the "Try it" link over the entire card */
.wp-block-group-is-layout-grid > .wp-block-group a[href] {
  position: static;
}

.wp-block-group-is-layout-grid > .wp-block-group a[href]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
