/*
Theme Name: World Habitat
Theme URI: https://bellamystudio.com/
Author: Paul Bellamy, Bellamy Studio
Author URI: https://bellamystudio.com/
Description: Custom theme for World Habitat
Version: 1.1.8
Requires at least: 6.1
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: worldhabitat
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/

/**
 * Custom editor styles for Bellamy Studio theme
 */

/* Main column width */
/* .editor-styles-wrapper .wp-block {
  max-width: 100%;
} */

/* Width of "wide" blocks */
.editor-styles-wrapper .wp-block[data-align="wide"] {
  max-width: 100%;
}

/* Width of "full-wide" blocks */
.editor-styles-wrapper .wp-block[data-align="full"] {
  max-width: none;
}

/* Editor Styles for Accordions */
.wp-block-details {
  --accordion-title-color: inherit;
  --accordion-text-color: inherit;
  --accordion-background-color: transparent;
  --accordion-border-color: #ccc;
}

.wp-block-details summary {
  color: var(--accordion-title-color);
  font-weight: 500;
}

.wp-block-details p {
  color: var(--accordion-text-color);
}

/* Group-based accordion styling for editor - improved specificity and force refresh */
.editor-styles-wrapper .is-accordion-primary details,
.editor-styles-wrapper .is-accordion-primary .wp-block-details,
.editor-styles-wrapper .wp-block-group.is-accordion-primary .wp-block-details,
.editor-styles-wrapper .is-selected.is-accordion-primary .wp-block-details,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-primary
  .wp-block-details,
[data-type="core/group"].is-accordion-primary .wp-block-details {
  background-color: var(--wp--preset--color--primary) !important;
  border-color: var(--wp--preset--color--primary) !important;
  transition: background-color 0s !important; /* Force immediate update */
}

.editor-styles-wrapper .is-accordion-primary details summary,
.editor-styles-wrapper .is-accordion-primary details p,
.editor-styles-wrapper .is-accordion-primary .wp-block-details summary,
.editor-styles-wrapper .is-accordion-primary .wp-block-details p,
.editor-styles-wrapper
  .wp-block-group.is-accordion-primary
  .wp-block-details
  summary,
.editor-styles-wrapper .wp-block-group.is-accordion-primary .wp-block-details p,
.editor-styles-wrapper
  .is-selected.is-accordion-primary
  .wp-block-details
  summary,
.editor-styles-wrapper .is-selected.is-accordion-primary .wp-block-details p,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-primary
  .wp-block-details
  summary,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-primary
  .wp-block-details
  p,
[data-type="core/group"].is-accordion-primary .wp-block-details summary,
[data-type="core/group"].is-accordion-primary .wp-block-details p {
  color: var(--wp--preset--color--background) !important;
  transition: color 0s !important; /* Force immediate update */
}

.editor-styles-wrapper .is-accordion-secondary details,
.editor-styles-wrapper .is-accordion-secondary .wp-block-details,
.editor-styles-wrapper .wp-block-group.is-accordion-secondary .wp-block-details,
.editor-styles-wrapper .is-selected.is-accordion-secondary .wp-block-details,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-secondary
  .wp-block-details,
[data-type="core/group"].is-accordion-secondary .wp-block-details {
  background-color: var(--wp--preset--color--secondary) !important;
  border-color: var(--wp--preset--color--secondary) !important;
  transition: background-color 0s !important; /* Force immediate update */
}

.editor-styles-wrapper .is-accordion-secondary details summary,
.editor-styles-wrapper .is-accordion-secondary details p,
.editor-styles-wrapper .is-accordion-secondary .wp-block-details summary,
.editor-styles-wrapper .is-accordion-secondary .wp-block-details p,
.editor-styles-wrapper
  .wp-block-group.is-accordion-secondary
  .wp-block-details
  summary,
.editor-styles-wrapper
  .wp-block-group.is-accordion-secondary
  .wp-block-details
  p,
.editor-styles-wrapper
  .is-selected.is-accordion-secondary
  .wp-block-details
  summary,
.editor-styles-wrapper .is-selected.is-accordion-secondary .wp-block-details p,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-secondary
  .wp-block-details
  summary,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-secondary
  .wp-block-details
  p,
[data-type="core/group"].is-accordion-secondary .wp-block-details summary,
[data-type="core/group"].is-accordion-secondary .wp-block-details p {
  color: var(--wp--preset--color--background) !important;
  transition: color 0s !important; /* Force immediate update */
}

.editor-styles-wrapper .is-accordion-tertiary details,
.editor-styles-wrapper .is-accordion-tertiary .wp-block-details,
.editor-styles-wrapper .wp-block-group.is-accordion-tertiary .wp-block-details,
.editor-styles-wrapper .is-selected.is-accordion-tertiary .wp-block-details,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-tertiary
  .wp-block-details,
[data-type="core/group"].is-accordion-tertiary .wp-block-details {
  background-color: var(--wp--preset--color--primary-tint) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--wp--preset--color--off-black);
  transition: background-color 0s !important; /* Force immediate update */
}

.editor-styles-wrapper .is-accordion-tertiary details summary,
.editor-styles-wrapper .is-accordion-tertiary details p,
.editor-styles-wrapper .is-accordion-tertiary .wp-block-details summary,
.editor-styles-wrapper .is-accordion-tertiary .wp-block-details p,
.editor-styles-wrapper
  .wp-block-group.is-accordion-tertiary
  .wp-block-details
  summary,
.editor-styles-wrapper
  .wp-block-group.is-accordion-tertiary
  .wp-block-details
  p,
.editor-styles-wrapper
  .is-selected.is-accordion-tertiary
  .wp-block-details
  summary,
.editor-styles-wrapper .is-selected.is-accordion-tertiary .wp-block-details p,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-tertiary
  .wp-block-details
  summary,
.editor-styles-wrapper
  .block-editor-block-list__block.is-accordion-tertiary
  .wp-block-details
  p,
[data-type="core/group"].is-accordion-tertiary .wp-block-details summary,
[data-type="core/group"].is-accordion-tertiary .wp-block-details p {
  color: var(--wp--preset--color--background) !important;
  transition: color 0s !important; /* Force immediate update */
}

/* Indicate accordion groups in the editor */
.editor-styles-wrapper .wp-block-group.is-accordion-primary,
.editor-styles-wrapper [data-type="core/group"].is-accordion-primary {
  outline: 3px dashed var(--wp--preset--color--primary) !important;
  outline-offset: 2px !important;
  transition: outline 0s !important;
}

.editor-styles-wrapper .wp-block-group.is-accordion-secondary,
.editor-styles-wrapper [data-type="core/group"].is-accordion-secondary {
  outline: 3px dashed var(--wp--preset--color--secondary) !important;
  outline-offset: 2px !important;
  transition: outline 0s !important;
}

.editor-styles-wrapper .wp-block-group.is-accordion-tertiary,
.editor-styles-wrapper [data-type="core/group"].is-accordion-tertiary {
  outline: 3px dashed var(--wp--preset--color--tertiary) !important;
  outline-offset: 2px !important;
  transition: outline 0s !important;
}

/* Force immediate update of block when selected */
.editor-styles-wrapper .wp-block-group.is-selected {
  z-index: 1;
}

/**
 * Horizontal Slider Editor Styles
 */

/* Make the slider structure visible in the editor */
.editor-styles-wrapper .horizontal-slider {
  border: 1px dashed #ccc;
  padding: 20px;
  margin-bottom: 20px;
}

.editor-styles-wrapper .horizontal-slider:before {
  content: "Horizontal Slider";
  position: absolute;
  top: -10px;
  left: 20px;
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  color: #757575;
}

/* Make the slides appear in a row */
.editor-styles-wrapper .horizontal-slider .splide__list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px !important;
  overflow-x: auto !important;
  padding: 10px 0 !important;
}

/* Style each slide */
.editor-styles-wrapper .horizontal-slider .splide__slide {
  flex: 0 0 calc(33.333% - 14px) !important;
  min-width: 250px !important;
  box-shadow: 0 0 0 1px #eee;
  margin-block-start: 0;
}

/* Editor styles for slide width variations */
.editor-styles-wrapper
  .horizontal-slider[data-slide-width="normal"]
  .splide__track {
  width: 100% !important;
}

.editor-styles-wrapper
  .horizontal-slider[data-slide-width="wide"]
  .splide__track {
  width: calc(100% + 80px) !important;
  margin-left: -40px !important;
  margin-right: -40px !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
  background-color: rgba(0, 0, 0, 0.02) !important;
}

.editor-styles-wrapper
  .horizontal-slider[data-slide-width="full"]
  .splide__track {
  width: calc(100% + 120px) !important;
  margin-left: -60px !important;
  margin-right: -60px !important;
  padding-left: 60px !important;
  padding-right: 60px !important;
  background-color: rgba(0, 0, 0, 0.03) !important;
}

/* Adjust slide sizes */
.editor-styles-wrapper
  .horizontal-slider[data-slide-width="wide"]
  .splide__slide {
  flex: 0 0 calc(33.333% - 12px) !important;
}

.editor-styles-wrapper
  .horizontal-slider[data-slide-width="full"]
  .splide__slide {
  flex: 0 0 calc(33.333% - 10px) !important;
}

/* When a slide is selected */
.editor-styles-wrapper .horizontal-slider .splide__slide.is-selected {
  box-shadow: 0 0 0 2px var(--wp--preset--color--primary);
}

/* Add focus styles to make it clear which slide is being edited */
.editor-styles-wrapper .horizontal-slider .splide__slide:focus-within {
  outline: 2px solid var(--wp--preset--color--primary);
}

/**
 * Sticky Side Scroll Editor Styles
 */
.editor-styles-wrapper .sticky-side--left {
  position: sticky;
  top: 0;
}

/**
 * Animation controls editor preview styles
 */

/* Apply subtle visual markers for blocks with animations */
.editor-styles-wrapper .animate__animated {
  position: relative;
  /* Ensure content is visible in the editor */
  opacity: 1 !important;
  transform: none !important;
}

/* Add indicator for blocks with animations */
.editor-styles-wrapper .animate__animated::before {
  content: "✨";
  position: absolute;
  top: -20px;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  z-index: 100;
  opacity: 0.7;
}

/* Add animation type label */
.editor-styles-wrapper .animate__fadeIn::after {
  content: "fade in";
}
.editor-styles-wrapper .animate__fadeInDown::after {
  content: "fade down";
}
.editor-styles-wrapper .animate__fadeInUp::after {
  content: "fade up";
}
.editor-styles-wrapper .animate__fadeInLeft::after {
  content: "fade left";
}
.editor-styles-wrapper .animate__fadeInRight::after {
  content: "fade right";
}

.editor-styles-wrapper .animate__fadeIn::after,
.editor-styles-wrapper .animate__fadeInDown::after,
.editor-styles-wrapper .animate__fadeInUp::after,
.editor-styles-wrapper .animate__fadeInLeft::after,
.editor-styles-wrapper .animate__fadeInRight::after {
  position: absolute;
  top: -20px;
  left: 26px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1;
  z-index: 100;
  opacity: 0.7;
  font-family: monospace;
}

/* Add subtle border to blocks with animations */
.editor-styles-wrapper .animate__animated {
  outline: 1px dashed #0075af20;
}

/* Show indicators only on block hover or selection */
.editor-styles-wrapper .animate__animated::before,
.editor-styles-wrapper .animate__fadeIn::after,
.editor-styles-wrapper .animate__fadeInDown::after,
.editor-styles-wrapper .animate__fadeInUp::after,
.editor-styles-wrapper .animate__fadeInLeft::after,
.editor-styles-wrapper .animate__fadeInRight::after {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.editor-styles-wrapper .animate__animated:hover::before,
.editor-styles-wrapper .animate-text-chars:hover::before,
.editor-styles-wrapper .animate-text-words:hover::before,
.editor-styles-wrapper .animate-text-typewriter:hover::before {
  opacity: 1;
}

/* ===== HERO STICKY UTILITIES ===== */

/* Hero sticky effect (GSAP-powered) */
.hero-sticky {
  /* GSAP handles positioning and pinning */
  z-index: 0 !important;
}

/* Optional: Add fade effect during unstick */
.hero-sticky-fade {
  /* Fade will be applied by GSAP during scroll */
}

/* Ensure content sections have background and higher z-index */
.content-over-hero {
  background: var(--wp--preset--color--background, white);
  position: relative;
  z-index: 2;
}

/* Optional: Add a subtle shadow to content sections */
.content-over-hero {
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

/* Editor styles for hero sticky sections */
.editor-styles-wrapper .hero-sticky {
  outline: 2px dashed #0073aa;
  outline-offset: 4px;
}

.editor-styles-wrapper .hero-sticky::before {
  content: "STICKY HERO";
  position: absolute;
  top: 8px;
  left: 8px;
  background: #0073aa;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 1000;
  pointer-events: none;
}

.editor-styles-wrapper .content-over-hero::before {
  content: "CONTENT OVER HERO";
  position: absolute;
  top: 8px;
  left: 8px;
  background: #d63638;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 1000;
  pointer-events: none;
}

/* All root-level content sections stack above hero-sticky */
.wp-block-group.alignfull {
  position: relative;
  z-index: 2;
}

/* Font Size Classes */
.wp-block,
.editor-styles-wrapper .wp-block {
  /* font-size: var(--wp--preset--font-size--base); */
}

/* Remove hardcoded font size classes and let theme.json handle them */
.has-small-font-size,
.has-base-font-size,
.has-medium-font-size,
.has-large-font-size,
.has-x-large-font-size,
.has-xx-large-font-size,
.has-xxx-large-font-size {
  /* Let theme.json handle these */
}

/* Remove hardcoded font size override */
[style*="font-size: 36px"] {
  /* Let theme.json handle this */
}
