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


/* ==========================================================================
   Editor block types that had no front-end styling
   --------------------------------------------------------------------------
   The block editor emits table, callout and divider blocks, but nothing
   styled them, so they rendered with browser defaults on the public site â€”
   a table showed as borderless text, a callout as a plain paragraph.
   Colours follow the site palette (#2b6cb0 primary, #444 body text).
   ========================================================================== */

/* --- Tables ------------------------------------------------------------- */

/* The editor wraps every table in .table-responsive; the wrapper is what
   scrolls, so a wide table never widens the page itself. */
.post-content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.75rem 0;
}

.post-content .table-responsive > table,
.post-content > table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #444;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    /* border-radius on a collapsed table needs the overflow clip to show. */
    overflow: hidden;
}

.post-content table th,
.post-content table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #e7ecf2;
    border-right: 1px solid #e7ecf2;
    text-align: left;
    vertical-align: top;
}

.post-content table th:last-child,
.post-content table td:last-child {
    border-right: none;
}

.post-content table tr:last-child td {
    border-bottom: none;
}

.post-content table thead th {
    background: #eaf1f9;
    color: #2b6cb0;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid #2b6cb0;
}

/* Zebra striping keeps long price/duration tables readable. */
.post-content table tbody tr:nth-child(even) {
    background: #f7f9fc;
}

/* A table with no <thead> still gets an emphasised first row. */
.post-content table tbody tr:first-child th {
    background: #eaf1f9;
    color: #2b6cb0;
}

@media (max-width: 600px) {
    .post-content .table-responsive > table,
    .post-content > table {
        font-size: 0.9rem;
    }

    .post-content table th,
    .post-content table td {
        padding: 0.55rem 0.65rem;
    }
}

/* The editor sometimes wraps a cell's text in <p>; its margins made those rows
   taller than the rest. Cells keep their own padding, paragraphs inside add none. */
.post-content table td p,
.post-content table th p {
    margin: 0;
}

/* --- Lists --------------------------------------------------------------- *
   Bullets and numbers sit on the text's left edge; the item text is indented
   past them, so nothing hangs outside the column. */
.post-content ul,
.post-content ol {
    padding-left: 1.4em;
    margin: 0 0 1.25rem;
    list-style-position: outside;
}

.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin-bottom: 0;
}

/* --- Callouts ----------------------------------------------------------- */

.post-content .callout {
    display: flex;
    gap: 0.75rem;
    margin: 1.75rem 0;
    padding: 1rem 1.15rem;
    border-left: 4px solid #2b6cb0;
    border-radius: 6px;
    background: #eef4fb;
    color: #3a4654;
    line-height: 1.65;
}

.post-content .callout > :first-child { margin-top: 0; }
.post-content .callout > :last-child  { margin-bottom: 0; }

.post-content .callout-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: inherit;
}

.post-content .callout-icon {
    flex: 0 0 auto;
    line-height: 1.5;
}

.post-content .callout-info {
    border-left-color: #2b6cb0;
    background: #eef4fb;
}

.post-content .callout-success {
    border-left-color: #2f855a;
    background: #edf7f1;
    color: #2c4a3a;
}

.post-content .callout-warning {
    border-left-color: #c98a0b;
    background: #fdf5e6;
    color: #5c4813;
}

.post-content .callout-error,
.post-content .callout-danger {
    border-left-color: #c53030;
    background: #fdeded;
    color: #5c2020;
}

/* --- Dividers ----------------------------------------------------------- */

.post-content hr.divider {
    border: 0;
    border-top: 1px solid #dde3ea;
    margin: 2rem 0;
    height: 0;
}

.post-content hr.divider-dashed { border-top-style: dashed; }
.post-content hr.divider-dotted { border-top-style: dotted; }

.post-content hr.divider-thick {
    border-top-width: 3px;
    border-top-color: #2b6cb0;
}

/* --- Text size ----------------------------------------------------------- *
   The size dropdown wraps the selection in one of these classes rather than
   a raw <font> tag, so the size survives a round-trip through the HTML tab
   and can be restyled site-wide from here. */

.post-content .fs-sm   { font-size: 0.85em; }
.post-content .fs-md   { font-size: 1em; }
.post-content .fs-lg   { font-size: 1.25em; }
.post-content .fs-xl   { font-size: 1.5em; }
.post-content .fs-xxl  { font-size: 2em; }
