/* ================================================================
   Post Carousels & Grid for Elementor — v3.0
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Shared Card ───────────────────────────────────────────────── */
.pce-card {
    display: flex;
    flex-direction: column;
    background: #f2f2f2;
    border-radius: 15px;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}
.pce-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.15); }
.pce-no-posts { padding: 20px; color: #666; font-style: italic; }

/* ── Image Column Wrapper ──────────────────────────────────────── */
.pce-image-col {
    /* padding controlled by Elementor padding_around_image */
    flex-shrink: 0;
}

/* ── Image Wrap ────────────────────────────────────────────────── */
.pce-image-wrap {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #ccc;
    border-radius: 0;
}
.pce-image-wrap a { display: block; width: 100%; height: 100%; }
.pce-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; transition: transform .35s ease; }
.pce-image-wrap:hover img { transform: scale(1.05); }
.pce-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.pce-no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #e0e0e0;
}
.pce-no-image span { color: #888; font-size: .85rem; font-style: italic; text-align: center; padding: 12px; font-weight: 600; }

/* ── Card Footer ───────────────────────────────────────────────── */
.pce-card-footer {
    background: #00C9A7;
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background .25s;
}

/* ── Elements ──────────────────────────────────────────────────── */
.pce-term-label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.85);
    margin-bottom: 2px;
}
.pce-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px;
}
.pce-title a { color: #fff; text-decoration: none; transition: color .2s; }
.pce-title a:hover { opacity: .8; }
.pce-excerpt {
    font-size: .82rem;
    color: #fff;
    line-height: 1.55;
    flex: 1;
}
.pce-date, .pce-date-range, .pce-acf-row, .pce-author { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.85); }
.pce-acf-label, .pce-date-range-label, .pce-date-label { font-weight: 700; }
.pce-separator { border: none; border-top: 1px solid rgba(255,255,255,.3); margin: 4px 0; }

/* ── Read More Button ──────────────────────────────────────────── */
.pce-btn-wrap { display: flex; justify-content: flex-start; margin-top: 6px; }
.pce-btn {
    display: inline-block;
    padding: 8px 22px;
    background: #F5C518;
    color: #1a1a2e;
    font-size: .82rem;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    transition: background .2s, color .2s, opacity .2s;
    white-space: nowrap;
}
.pce-btn:hover { opacity: .88; }


/* ================================================================
   WIDGET 1 — 2-COL CAROUSEL
   ================================================================ */

/* ── Equal-height slides: Swiper sets .swiper-wrapper to display:flex,
   so slides stretch automatically when align-items is stretch (default).
   We just need cards to fill the slide height. ────────────────────── */
.pce-swiper .swiper-wrapper { align-items: stretch; }
.pce-swiper .swiper-slide   { height: auto; display: flex; }
.pce-swiper .swiper-slide > .pce-card { flex: 1; }

/* Within each card, the footer must fill remaining space so image area
   stays consistent — .pce-card is already flex-column with flex:1 on
   .pce-card-footer, so this is reinforced here: */
.pce-swiper .pce-card-footer { flex: 1; }

.pce-twocol-wrapper { position: relative; }
.pce-carousel-wrapper { position: relative; }
.pce-carousel-inner { position: relative; }

/* Row layout */
.pce-twocol-card {
    flex-direction: row !important;
    min-height: 300px;
    align-items: stretch;
}
/* Default: image bleeds edge-to-edge on left */
.pce-twocol-card .pce-twocol-image-col {
    flex: 0 0 42%;
    max-width: 42%;
    overflow: hidden;
}
.pce-twocol-card .pce-twocol-image-col .pce-image-wrap {
    height: 100%;
    min-height: 300px;
    border-radius: 0;
}
.pce-twocol-card .pce-twocol-image-col .pce-image-wrap img { height: 100%; }

/* Content column: flex col with vertical alignment */
.pce-twocol-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;  /* default: middle */
    padding: 28px 32px;
    border-radius: 0;
}
.pce-twocol-content .pce-title { font-size: 1.35rem; }
.pce-twocol-content .pce-excerpt { font-size: .9rem; }

/* ── UNIFIED MODE ─────────────────────────────────────────────────
   Card background covers entire card. Image sits inside with padding.
   ────────────────────────────────────────────────────────────────── */
.pce-twocol-unified {
    /* card bg is set by Elementor card_bg control */
    background-color: #00C9A7 !important;  /* will be overridden by Elementor selector */
}
.pce-twocol-unified .pce-twocol-image-col {
    /* no overflow clip — image is inside, with padding */
    overflow: visible;
    display: flex;
    align-items: center;
}
.pce-twocol-unified .pce-twocol-image-col .pce-image-col {
    width: 100%;
}
.pce-twocol-unified .pce-twocol-image-col .pce-image-wrap {
    width: 100%;
    /* padding applied by Elementor image_padding control on .pce-image-col */
    border-radius: 12px;   /* nice inset radius; overrideable */
    min-height: 240px;
}
/* Remove footer's own background in unified mode — card provides it */
.pce-twocol-unified .pce-twocol-content {
    background: transparent !important;
}

@media (max-width: 640px) {
    .pce-twocol-card { flex-direction: column !important; min-height: 0; }
    .pce-twocol-card .pce-twocol-image-col { flex: none; width: 100%; max-width: 100%; }
    .pce-twocol-card .pce-twocol-image-col .pce-image-wrap { min-height: 200px; }
}


/* ================================================================
   SHARED CAROUSEL NAV  (perfect circle by default)
   ================================================================ */

.pce-nav-btn {
    position: absolute;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;   /* perfect circle */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2e6f;
    color: #fff;
    transition: background .2s, opacity .2s, transform .15s;
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.pce-nav-btn:hover { opacity: .85; transform: translateY(-50%) scale(1.07); }
.pce-nav-btn i { line-height: 1; display: block; }
.pce-nav-btn svg { display: block; }
/* hidden at boundary (non-loop mode — JS adds class) */
.pce-nav-btn.pce-hidden { opacity: 0; pointer-events: none; }

.pce-prev { left: -26px; }
.pce-next { right: -26px; }

/* Swiper pagination */
.swiper-pagination { position: relative !important; bottom: auto !important; margin-top: 16px; }
.swiper-pagination-bullet { background: #ccc; opacity: 1; }
.swiper-pagination-bullet-active { background: #00C9A7; }


/* ================================================================
   WIDGET 3 — POST GRID
   ================================================================ */

.pce-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: stretch; /* rows already stretch by default; explicit for clarity */
}

/* Equal-height grid cards: card fills the grid cell, footer takes
   remaining space so image areas stay the same height per row. */
.pce-grid > .pce-card { height: 100%; }
.pce-grid > .pce-card .pce-card-footer { flex: 1; }

.pce-card-wide { grid-column: span 2; }
.pce-card-wide .pce-image-wrap { height: 320px; }

.pce-masonry-grid { column-count: 3; column-gap: 16px; }
.pce-masonry-grid .pce-card { break-inside: avoid; page-break-inside: avoid; margin-bottom: 16px; display: block; }
.pce-masonry-grid .pce-card .pce-card-footer { display: block; }

@media (max-width: 1023px) {
    .pce-grid { grid-template-columns: repeat(2, 1fr); }
    .pce-masonry-grid { column-count: 2; }
}
@media (max-width: 767px) {
    .pce-grid { grid-template-columns: 1fr; }
    .pce-masonry-grid { column-count: 1; }
    .pce-card-wide { grid-column: span 1; }
    .pce-card-wide .pce-image-wrap { height: 220px; }
}

/* Filter bar */
.pce-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pce-filter-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 2px solid #1a2e6f;
    background: transparent;
    color: #1a2e6f;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.pce-filter-btn:hover, .pce-filter-btn.is-active {
    background: #00C9A7; color: #fff; border-color: #00C9A7;
}

/* Load more */
.pce-load-more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.pce-load-more-btn {
    padding: 12px 40px;
    background: #1a2e6f; color: #fff;
    border: none; border-radius: 30px;
    font-size: .9rem; font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
}
.pce-load-more-btn:hover { opacity: .85; }
.pce-load-more-btn:disabled { opacity: .5; cursor: wait; }
