/**
 * Section Wrapper Base Styles
 * Provides fundamental structure and responsive layout
 * Themes should override colors/spacing via CSS Custom Properties
 */

/* CSS Custom Properties - Default fallbacks */
.wp-block-aps-section-wrapper {
  /* Base structure */
  --section-padding-y: 4rem;
  --section-padding-x: 1rem;
  --section-max-width: 1200px;
  
  /* Visual defaults - themes should override these */
  --section-bg: #ffffff;
  --section-text: #333333;
  --section-border: #ececec;
  --section-border-radius: 0;
  --section-shadow: none;
  
  /* Spacing modifiers */
  --section-spacing-small: 2rem;
  --section-spacing-large: 6rem;
  
  /* Transitions */
  --section-transition: all 0.25s ease;
}

/* Base section wrapper structure */
.wp-block-aps-section-wrapper {
  /* Plugin handles structure only - themes handle colors */
  position: relative;
  
  /* Responsive padding */
  padding: var(--section-padding-y) var(--section-padding-x);
  
}

/* Container for content */
.section-wrapper__container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Padding modifiers */
.wp-block-aps-section-wrapper.no-padding-top {
  padding-top: 0;
}

.wp-block-aps-section-wrapper.no-padding-bottom {
  padding-bottom: 0;
}

.wp-block-aps-section-wrapper.full-width {
  padding-left: 0;
  padding-right: 0;
}

/* Alignment support */
.wp-block-aps-section-wrapper[data-align="wide"] {
  --section-max-width: 1400px;
}

.wp-block-aps-section-wrapper[data-align="full"] {
  --section-max-width: none;
  --section-padding-x: 2rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .wp-block-aps-section-wrapper {
    --section-padding-y: 3rem;
    --section-padding-x: 1.5rem;
  }
}

@media (max-width: 768px) {
  .wp-block-aps-section-wrapper {
    --section-padding-y: 2rem;
    --section-padding-x: 1rem;
  }
}

@media (max-width: 480px) {
  .wp-block-aps-section-wrapper {
    --section-padding-y: 1.5rem;
    --section-padding-x: 0.75rem;
  }
  
  .wp-block-aps-section-wrapper[data-align="full"] {
    --section-padding-x: 1rem;
  }
}

/* Default theme presets - fallbacks only */
.wp-block-aps-section-wrapper.theme-preset--light {
  --section-bg: #ffffff;
  --section-text: #333333;
  --section-border: #ececec;
}

.wp-block-aps-section-wrapper.theme-preset--dark {
  --section-bg: #1a1a1a;
  --section-text: #ffffff;
  --section-border: #333333;
}

/* Nested wrapper warning styles */
.section-wrapper--nested-warning {
  border: 2px dashed #ff6b6b !important;
  position: relative;
}

.section-wrapper__nested-warning {
  background: #ff6b6b;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border-radius: 4px;
  text-align: center;
  position: relative;
  z-index: 10;
}

/* Ensure proper stacking context */
.wp-block-aps-section-wrapper {
  z-index: 1;
}

/* Support for gradient backgrounds - removed, handled by theme */

/* Inner blocks styling adjustments */
.wp-block-aps-section-wrapper > .section-wrapper__container > .wp-block {
  margin-top: 0;
}

.wp-block-aps-section-wrapper > .section-wrapper__container > .wp-block:last-child {
  margin-bottom: 0;
}

/* Accessibility improvements */
.wp-block-aps-section-wrapper:focus-visible {
  outline: 2px solid var(--section-border, #0073aa);
  outline-offset: 2px;
}