/* ==========================================================================
   Enhanced Heading Block Styles

   Comprehensive styling for the enhanced heading block with H1-H6 support,
   flexbox support, responsive design, and editor compatibility.
   ========================================================================== */
/* ==========================================================================
   Base Heading Block Styles
   ========================================================================== */
.merak-heading-container {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.merak-heading-block {
  position: relative;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
  margin: 0;
  transition: color 0.3s ease, background-color 0.3s ease;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.merak-heading-block a {
  color: inherit;
  text-decoration: underline;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}
.merak-heading-block a:hover, .merak-heading-block a:focus {
  text-decoration-color: transparent;
}
.merak-heading-block strong,
.merak-heading-block b {
  font-weight: bolder;
}
.merak-heading-block em,
.merak-heading-block i {
  font-style: italic;
}
.merak-heading-block:focus-visible {
  outline: 2px solid #005cee;
  outline-offset: 2px;
}

/* ==========================================================================
   Default Heading Sizes
   Typography inherited from global _overrides.scss
   ACF inline styles will override when set
   ========================================================================== */
/* ==========================================================================
   Flexbox Utilities
   ========================================================================== */
.merak-heading-container.flex-left {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}
.merak-heading-container.flex-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.merak-heading-container.flex-right {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
.merak-heading-container .merak-heading-block {
  flex-shrink: 1;
  min-width: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
/* ==========================================================================
   Editor-Specific Styles
   ========================================================================== */
.editor-styles-wrapper .merak-heading-container {
  position: relative;
}
.editor-styles-wrapper .merak-heading-container:hover .block-editor-block-list__block-edit, .editor-styles-wrapper .merak-heading-container.is-selected .block-editor-block-list__block-edit {
  outline: none;
}
.editor-styles-wrapper .merak-heading-container .block-editor-block-toolbar {
  position: relative;
  z-index: 100;
}
.editor-styles-wrapper .merak-heading-container .components-panel {
  position: relative;
}
.editor-styles-wrapper .merak-heading-block {
  position: relative;
  min-height: 1.5em;
}
.editor-styles-wrapper .merak-heading-block[style*="position: absolute"], .editor-styles-wrapper .merak-heading-block[style*="position: fixed"] {
  outline: 2px dashed rgba(255, 140, 0, 0.3);
  outline-offset: 2px;
}
.editor-styles-wrapper .merak-heading-block[style*="position: absolute"]:before, .editor-styles-wrapper .merak-heading-block[style*="position: fixed"]:before {
  content: "Positioned Heading";
  position: absolute;
  top: -24px;
  left: 0;
  background: rgba(255, 140, 0, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
  z-index: 1000;
}
.editor-styles-wrapper .merak-heading-block[style*="display: none"] {
  display: block !important;
  opacity: 0.3;
  outline: 2px dashed rgba(255, 0, 0, 0.5);
  outline-offset: 2px;
}
.editor-styles-wrapper .merak-heading-block[style*="display: none"]:before {
  content: "Hidden Heading (display: none)";
  position: absolute;
  top: -24px;
  left: 0;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
  z-index: 1000;
}
.editor-styles-wrapper .merak-heading-block[style*="display: flex"], .editor-styles-wrapper .merak-heading-block[style*="display: grid"] {
  outline: 2px dashed rgba(0, 200, 0, 0.3);
  outline-offset: 2px;
}
.editor-styles-wrapper .merak-heading-block[style*="display: flex"]:before {
  content: "Flex Heading Container";
  position: absolute;
  top: -24px;
  left: 0;
  background: rgba(0, 200, 0, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
  z-index: 1000;
}
.editor-styles-wrapper .merak-heading-block[style*="display: grid"]:before {
  content: "Grid Heading Container";
  position: absolute;
  top: -24px;
  left: 0;
  background: rgba(0, 150, 200, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
  z-index: 1000;
}
.editor-styles-wrapper .merak-heading-block[style*=border-width][style*=border-style] {
  position: relative;
}
.editor-styles-wrapper .merak-heading-block[style*="border:"]:not([style*="border: 0"]):before, .editor-styles-wrapper .merak-heading-block[style*=border-width]:not([style*="border-width: 0"]):before {
  content: "Has Border";
  position: absolute;
  top: -24px;
  right: 0;
  background: rgba(139, 69, 19, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
  z-index: 1000;
}

.merak-heading-placeholder {
  color: #999;
  font-style: italic;
  padding: 1rem;
  border: 2px dashed #ddd;
  border-radius: 4px;
  text-align: center;
  background-color: #f9f9f9;
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */
@media (prefers-contrast: high) {
  .merak-heading-block {
    text-shadow: none;
  }
  .merak-heading-block a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .merak-heading-block,
  .merak-heading-block a {
    transition: none;
  }
}
/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .merak-heading-container {
    display: block !important;
  }
  .merak-heading-block {
    color: black !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  .merak-heading-block a {
    color: black !important;
    text-decoration: underline !important;
  }
  .merak-heading-block a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
/* ==========================================================================
   Positioning Utilities
   ========================================================================== */
.merak-heading-block.position-relative {
  position: relative;
}
.merak-heading-block.position-absolute {
  position: absolute;
}
.merak-heading-block.position-fixed {
  position: fixed;
}
.merak-heading-block.position-sticky {
  position: sticky;
}
.merak-heading-block.z-auto {
  z-index: auto;
}
.merak-heading-block.z-0 {
  z-index: 0;
}
.merak-heading-block.z-10 {
  z-index: 10;
}
.merak-heading-block.z-20 {
  z-index: 20;
}
.merak-heading-block.z-30 {
  z-index: 30;
}
.merak-heading-block.z-40 {
  z-index: 40;
}
.merak-heading-block.z-50 {
  z-index: 50;
}
.merak-heading-block.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}
.merak-heading-block.overlay-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}
.merak-heading-block.corner-top-left {
  position: absolute;
  top: 1rem;
  left: 1rem;
}
.merak-heading-block.corner-top-right {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.merak-heading-block.corner-bottom-left {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
}
.merak-heading-block.corner-bottom-right {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
}
.merak-heading-block.display-none {
  display: none;
}
.merak-heading-block.display-block {
  display: block;
}
.merak-heading-block.display-inline {
  display: inline;
}
.merak-heading-block.display-inline-block {
  display: inline-block;
}
.merak-heading-block.display-flex {
  display: flex;
}
.merak-heading-block.display-inline-flex {
  display: inline-flex;
}
.merak-heading-block.display-grid {
  display: grid;
}
.merak-heading-block.display-inline-grid {
  display: inline-grid;
}
.merak-heading-block.order-first {
  order: -999;
}
.merak-heading-block.order-last {
  order: 999;
}
.merak-heading-block.order-none {
  order: 0;
}
.merak-heading-block.order-1 {
  order: 1;
}
.merak-heading-block.order-2 {
  order: 2;
}
.merak-heading-block.order-3 {
  order: 3;
}
.merak-heading-block.order-4 {
  order: 4;
}
.merak-heading-block.order-5 {
  order: 5;
}
.merak-heading-block.border-solid {
  border-style: solid;
}
.merak-heading-block.border-dashed {
  border-style: dashed;
}
.merak-heading-block.border-dotted {
  border-style: dotted;
}
.merak-heading-block.border-double {
  border-style: double;
}
.merak-heading-block.border-none {
  border: none;
}
.merak-heading-block.border-0 {
  border-width: 0;
}
.merak-heading-block.border-1 {
  border-width: 1px;
}
.merak-heading-block.border-2 {
  border-width: 2px;
}
.merak-heading-block.border-4 {
  border-width: 4px;
}
.merak-heading-block.border-8 {
  border-width: 8px;
}
.merak-heading-block.rounded-none {
  border-radius: 0;
}
.merak-heading-block.rounded-sm {
  border-radius: 2px;
}
.merak-heading-block.rounded {
  border-radius: 4px;
}
.merak-heading-block.rounded-md {
  border-radius: 6px;
}
.merak-heading-block.rounded-lg {
  border-radius: 8px;
}
.merak-heading-block.rounded-xl {
  border-radius: 12px;
}
.merak-heading-block.rounded-2xl {
  border-radius: 16px;
}
.merak-heading-block.rounded-3xl {
  border-radius: 24px;
}
.merak-heading-block.rounded-full {
  border-radius: 9999px;
}
.merak-heading-block.border-t {
  border-top-width: 1px;
}
.merak-heading-block.border-r {
  border-right-width: 1px;
}
.merak-heading-block.border-b {
  border-bottom-width: 1px;
}
.merak-heading-block.border-l {
  border-left-width: 1px;
}
.merak-heading-block.border-transparent {
  border-color: transparent;
}
.merak-heading-block.border-current {
  border-color: currentColor;
}
.merak-heading-block.border-black {
  border-color: #000000;
}
.merak-heading-block.border-white {
  border-color: #ffffff;
}
.merak-heading-block.border-gray {
  border-color: #6b7280;
}
.merak-heading-block.text-left {
  text-align: left;
}
.merak-heading-block.text-center {
  text-align: center;
}
.merak-heading-block.text-right {
  text-align: right;
}
.merak-heading-block.text-justify {
  text-align: justify;
}
.merak-heading-block.font-light {
  font-weight: 300;
}
.merak-heading-block.font-normal {
  font-weight: 400;
}
.merak-heading-block.font-medium {
  font-weight: 500;
}
.merak-heading-block.font-semibold {
  font-weight: 600;
}
.merak-heading-block.font-bold {
  font-weight: 700;
}
.merak-heading-block.font-extrabold {
  font-weight: 800;
}
.merak-heading-block.font-public-sans {
  font-family: "Public Sans", sans-serif;
}
.merak-heading-block.font-lora {
  font-family: "Lora", serif;
}
.merak-heading-block.font-open-sans {
  font-family: "Open Sans", sans-serif;
}
.merak-heading-block.font-inter {
  font-family: "Inter", sans-serif;
}
.merak-heading-block.font-roboto {
  font-family: "Roboto", sans-serif;
}
.merak-heading-block.font-poppins {
  font-family: "Poppins", sans-serif;
}
.merak-heading-block.font-montserrat {
  font-family: "Montserrat", sans-serif;
}
.merak-heading-block.font-playfair {
  font-family: "Playfair Display", serif;
}
.merak-heading-block.font-merriweather {
  font-family: "Merriweather", serif;
}
.merak-heading-block.font-source-sans {
  font-family: "Source Sans Pro", sans-serif;
}
.merak-heading-block.font-nunito {
  font-family: "Nunito", sans-serif;
}
.merak-heading-block.font-raleway {
  font-family: "Raleway", sans-serif;
}
.merak-heading-block.font-oswald {
  font-family: "Oswald", sans-serif;
}
.merak-heading-block.font-system-ui {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.merak-heading-block.font-georgia {
  font-family: Georgia, "Times New Roman", Times, serif;
}
.merak-heading-block.font-times {
  font-family: "Times New Roman", Times, serif;
}
.merak-heading-block.font-arial {
  font-family: Arial, Helvetica, sans-serif;
}
.merak-heading-block.font-helvetica {
  font-family: Helvetica, Arial, sans-serif;
}
.merak-heading-block.font-courier {
  font-family: "Courier New", Courier, monospace;
}
.merak-heading-block.no-margin {
  margin: 0 !important;
}
.merak-heading-block.no-padding {
  padding: 0 !important;
}
.merak-heading-block.has-background {
  padding: 1rem;
  border-radius: 4px;
}

/* ==========================================================================
   Editor Styles - Ensure 1:1 parity with frontend
   ========================================================================== */
html .editor-styles-wrapper .merak-heading-container {
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

html .editor-styles-wrapper .merak-heading-block {
  position: relative !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
  margin: 0 !important;
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  transition: color 0.3s ease, background-color 0.3s ease !important;
}

html .editor-styles-wrapper .merak-heading-block a {
  text-decoration: underline !important;
  transition: color 0.3s ease, text-decoration-color 0.3s ease !important;
}
html .editor-styles-wrapper .merak-heading-block a:hover, html .editor-styles-wrapper .merak-heading-block a:focus {
  text-decoration-color: transparent !important;
}

html .editor-styles-wrapper .merak-heading-block strong,
html .editor-styles-wrapper .merak-heading-block b {
  font-weight: bolder !important;
}

html .editor-styles-wrapper .merak-heading-block em,
html .editor-styles-wrapper .merak-heading-block i {
  font-style: italic !important;
}

html .editor-styles-wrapper .merak-heading-block:focus-visible {
  outline: 2px solid #005cee !important;
  outline-offset: 2px !important;
}

html .editor-styles-wrapper .merak-heading-container.flex-left {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

html .editor-styles-wrapper .merak-heading-container.flex-center {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

html .editor-styles-wrapper .merak-heading-container.flex-right {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: flex-start !important;
}

html .editor-styles-wrapper .merak-heading-container .merak-heading-block {
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

html .editor-styles-wrapper .merak-heading-block[style] {
  all: unset !important;
  display: block !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* ==========================================================================
   Integration with Bulma (if present)
   ========================================================================== */
.column .merak-heading-container {
  width: 100%;
}

.columns .merak-heading-container {
  flex: 1;
}

.content .merak-heading-block {
  margin-bottom: 1rem;
}
.content .merak-heading-block:last-child {
  margin-bottom: 0;
}
