/* 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;
  }
}

/* Blockquote */
blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1.5rem 1.75rem 1.5rem 3.25rem;
    background: #f8fafc;
    border-left: 4px solid #2b6cb0;
    border-radius: 0 8px 8px 0;
    font-family: 'Merriweather', serif;
    font-style: italic;
    color: #2d3748;
    font-size: 1.15rem;
    line-height: 1.7;
}

blockquote::before {
    content: "\201C";
    position: absolute;
    top: -0.35rem;
    left: 0.75rem;
    font-family: 'Merriweather', serif;
    font-size: 4rem;
    font-style: normal;
    line-height: 1;
    color: #2b6cb0;
    opacity: 0.25;
    pointer-events: none;
}

blockquote p {
    margin: 0;
}

blockquote p + p {
    margin-top: 0.9rem;
}

blockquote cite {
    display: block;
    margin-top: 0.9rem;
    font-family: 'Roboto', sans-serif;
    font-style: normal;
    font-size: 0.9rem;
    color: #4a5568;
}

blockquote cite::before {
    content: "\2014\00a0";
    color: #718096;
}

blockquote cite a {
    color: #2b6cb0;
    text-decoration: none;
}

blockquote cite a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    blockquote {
        padding: 1.25rem 1rem 1.25rem 2.5rem;
        font-size: 1.05rem;
    }

    blockquote::before {
        font-size: 3rem;
        left: 0.5rem;
        top: -0.15rem;
    }
}
