/* Block Editor Frontend Styles - Grid System */

/* Multi-Column Layouts */
.block-row {
  display: flex;
  gap: 20px;
  align-items: stretch;
  margin: 1.5rem 0;
  position: relative;
  width: 100%;
}

.block-col {
  flex: 1;
  min-width: 0; /* Prevent flex items from overflowing */
  position: relative;
  box-sizing: border-box;
}

/* Image Alignment and Resizing Wrappers */
.resizable-wrapper {
  display: block;
  position: relative;
  max-width: 100%;
  margin: 1rem 0;
  clear: both; /* Prevent wrapping issues */
}

.resizable-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Alignment Classes */
.resizable-wrapper.align-left {
  float: left;
  margin-right: 20px;
  margin-bottom: 15px;
  max-width: 50%;
}

.resizable-wrapper.align-center {
  display: block;
  margin: 1.5rem auto;
  text-align: center;
}

.resizable-wrapper.align-right {
  float: right;
  margin-left: 20px;
  margin-bottom: 15px;
  max-width: 50%;
}

/* Captions */
.resizable-wrapper figcaption {
  display: block;
  text-align: center;
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  margin-top: 8px;
  line-height: 1.4;
}

/* Typography adjustments within blocks */
.block-col p {
    margin-bottom: 1rem;
}

.block-col p:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .block-row {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .block-col {
    width: 100% !important; /* Override inline styles from editor */
    flex: none !important;
  }

  /* Reset floated images on mobile */
  .resizable-wrapper.align-left,
  .resizable-wrapper.align-right {
    float: none;
    margin: 1.5rem auto;
    display: block;
    max-width: 100%;
    text-align: center;
  }
  
  .resizable-wrapper img {
    margin: 0 auto;
  }
}
