/* ==========================================================================
   E1-SECB — kindy-s3s6s8.css
   S3 Classes carousel · S6 Our News masonry · S8 Our happy parents.

   The card / carousel internals are already styled by the theme design system
   `themes/smarty/assets/css/kindergarten/main.css` (`.courses_post__box`,
   `.stm-carousel_view_courses`, `.post_view_grid`, `.stm-testimonial_style_1`,
   `.stm-carousel_type_testimonials`) — this file only carries the REF band
   paddings / heading margins + the responsive overflow guard.

   REF paddings: PLAN.md §3.1 (S3 0/0; S6 = `.tb-sec` 47/70; S8+S9 shared row
   top 37 / bottom 23). REF headings are inline-styled in
   `ref/sections/{S3_classes_carousel,S6_our_news_masonry,
   S8_testimonials_and_s9_faq}.html`.
   ========================================================================== */

/* --- S3 Classes carousel — REF row pad 0/0, heading centred, mb 41 -------- */
.tb-classes-carousel .tb-sec--classes {
    padding-top: 0;
    padding-bottom: 0;
}

.tb-classes-carousel .tb-sec-h1 {
    margin-bottom: 41px;
}

/* --- S6 Our News masonry — REF pad 47/70, heading centred, mb 41 ---------- */
.tb-news-masonry .tb-sec--news {
    padding-top: 47px;
    padding-bottom: 70px;
}
.tb-news-masonry .tb-sec-h1 {
    margin-bottom: 41px;
}

/* --- S8 Our happy parents — REF heading left, mb 29 -----------------------
   The S8/S9 band padding (37/23) now lives on the shared row class
   `vc_custom_1474635508301` (kindy-custom.css:9), carried by home.blade.php's
   `.tb-s8s9-band` row — so `.tb-testimonials .tb-sec--testimonials` is dead
   (no blade emits `tb-sec--testimonials` any more, R3-CAROUSEL item 6). */
.tb-testimonials .tb-sec-h1 {
    text-align: left;
    margin-bottom: 29px;
}

/* --- Responsive overflow guard -------------------------------------------
   The theme's course-carousel nav is absolutely positioned at width:100% and
   the prev/next buttons sit on -80px negative margins
   (main.css:4848-4849 / 4874). At wide viewports the 80px still lands inside
   the page gutter, but below ~1330px it extends past the viewport and makes
   `document.scrollWidth > clientWidth`. Pull the arrows back inside at those
   widths — card/carousel geometry is untouched. */
@media (max-width: 1329px) {
    .tb-classes-carousel .stm-carousel_view_courses.owl-carousel .owl-controls .owl-nav .owl-prev {
        margin-left: 0;
    }
    .tb-classes-carousel .stm-carousel_view_courses.owl-carousel .owl-controls .owl-nav .owl-next {
        margin-right: 0;
    }
}

@media (max-width: 767px) {
    /* Single-column masonry / carousel: never let a card exceed the viewport. */
    .tb-news-masonry .stm-posts__items-row_view_masonry,
    .tb-classes-carousel .courses_post__box {
        max-width: 100%;
    }
}

/* =====================================================================
   R7-NEWS — client round 3, item 4. "Our News" cards: identical layout,
   meta row aligned, and the template's band metrics.
   Root cause of the reported "middle card metadata overlaps the description":
   the theme sets `.post_view_grid .entry-meta { position: absolute; bottom: 25px }`
   inside `.entry-details` (min-height 220, padding-bottom 49). A meta row whose
   content wraps grows UPWARD from that fixed bottom anchor, so in the cards whose
   titles wrap to two lines it collides with the summary and its top y differs
   card to card (measured 4250 / 4192 / 4221).
   Fix: make the details a flex column and put the meta back in normal flow pinned
   to the bottom (`margin-top:auto`) — every card is already 411px tall, so all
   three meta rows then land on the same y with no overlap.
   ===================================================================== */
.tb-news-masonry .post_view_grid .entry-details-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tb-news-masonry .post_view_grid .entry-details {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 25px;   /* keep a consistent 25px floor below the meta */
}
.tb-news-masonry .post_view_grid .entry-summary { flex: 1 1 auto; }
.tb-news-masonry .post_view_grid .entry-summary p { margin-bottom: 0; }
.tb-news-masonry .post_view_grid .entry-meta {
  position: static;       /* was absolute -> the overlap source */
  margin-top: auto;       /* pin to the card's bottom, same y in every card */
  padding-top: 12px;
}
/* let a two-line title push the summary instead of the meta */
.tb-news-masonry .post_view_grid .entry-title { min-height: 60px; }

/* Band metrics to match the template exactly (REF: band 708, heading 82px below
   the band top; measured before this change: band 673, heading offset 47). */
.tb-news-masonry .tb-sec--news { padding-top: 82px !important; }

/* Equal card heights + a single-line meta row.
   After the flow fix the meta grew to 41/99/70px because the long permalink slug
   wrapped inside the floated `.entry-meta-category`, which made the cards
   423/481/452 tall (client requires all three equal and aligned).
   Now: the card is a fixed 411px flex column at >=1200px (the height the three
   cards already shared; see R11-NEWS below for the narrow-width behaviour), and
   the meta is a single nowrap row (date left, permalink right, the slug
   ellipsised when it is long). */
/* R11-NEWS (D1): the fixed `height: 411px; overflow: hidden` above only holds where
   the card content actually fits. At >=1200px the three 350px columns all land the
   meta -14px inside the card, so the fixed equal-height card is safe there. Below
   1200 the title/summary wrap taller and the same fixed height pushed the meta row
   past the card bottom (measured 1024 +13, 900/768 +61 = the whole 41px row
   invisible, 375 +11) where `overflow: hidden` clipped it. The card is therefore
   `min-height: 411px` by default (grows with its content, meta stays inside) and
   keeps the fixed 411px + clip only at the width where it is proven to fit. */
.tb-news-masonry .tb-news-card {
  display: flex;
  flex-direction: column;
  min-height: 411px;
}
@media (min-width: 1200px) {
  .tb-news-masonry .tb-news-card {
    height: 411px;
    overflow: hidden;
  }
}
.tb-news-masonry .tb-news-card .entry-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tb-news-masonry .post_view_grid .entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}
.tb-news-masonry .post_view_grid .entry-meta-auhtor,
.tb-news-masonry .post_view_grid .entry-meta-category {
  float: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-news-masonry .post_view_grid .entry-meta-category { text-align: right; }
