/*
 * OVRE Visionary Arts - Custom Styles
 *
 * Add your custom CSS and overrides in this file.
 * It is loaded after all other stylesheets, so your rules will take precedence.
 */

/* Ensure all images are responsive by default */
.attachment-post-thumbnail,
.wp-block-image img,
.wp-image-199,
.wp-image-153,
.wp-image-225,
.size-full img,
.is-resized img,
.img-fluid {
  max-width: 100%;
  height: auto !important;
  width: auto !important;
  display: block;
}

/* Prevent Bootstrap or WordPress from forcing fixed height/width */
.wp-block-image img[width],
.wp-block-image img[height] {
  width: 100% !important;
  height: auto !important;
}

/* Text wrapping improvements for WordPress content areas */
.entry-content,
.wp-block-group__inner-container,
.content,
article .col-lg-10,
article .col-xl-8 {
  overflow: hidden; /* Contain floated elements */
}

/* Ensure proper line height and text flow around images */
.entry-content p,
.content p,
article p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Bootstrap-focused Image Alignment */
.d-flex.justify-content-center {
  width: 100%;
}

.d-flex.justify-content-center .figure,
.d-flex.justify-content-center .text-center {
  margin: 0 auto;
}

/* Ensure Bootstrap flex containers work properly with images */
.d-flex.justify-content-center img {
  max-width: 100%;
  height: auto;
}

/* Legacy WordPress alignment support - minimal overrides, prefer Bootstrap */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  clear: both;
}

.alignleft {
  float: left;
  margin-right: 1rem;
  margin-bottom: 1rem;
  clear: left;
}

.alignright {
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
  clear: right;
}

/* Bootstrap gallery centering - flexbox approach */
.row.g-3 .col-12.d-flex.justify-content-center {
  display: flex !important;
  justify-content: center !important;
}

/* Gallery alignment containers for proper text wrapping */
.float-start,
.float-end {
  clear: both;
}

/* Ensure proper spacing around gallery containers */
.float-start.me-3,
.float-end.ms-3 {
  margin-bottom: 1rem;
}

/* Standalone image centering - flexbox approach */
.d-flex.justify-content-center.text-center {
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  text-align: center;
}

.d-flex.justify-content-center.text-center img {
  max-width: 100%;
  height: auto;
}

/* Responsive alignment - rely on Bootstrap utilities where possible */
@media (max-width: 575.98px) {
  /* On small screens, disable floats for better mobile experience */
  .float-start,
  .float-end,
  .alignleft,
  .alignright {
    float: none !important;
    display: block;
    margin: 1rem auto;
    max-width: 100%;
  }
}
