/**
 * Tiger Post — front-end styles.
 *
 * Widget-scoped class names (tg-tp-*) so this carousel never collides with
 * any other Tiger carousel on the page. Layout driven by inline CSS
 * variables emitted on the holder so changing Slides-per-View /
 * Space-Between updates the editor preview instantly with no gap flicker.
 *
 * Typography/colors/borders/paddings are driven by per-widget Elementor
 * Style controls (which can be linked to Global Colors / Global Fonts) and
 * fall back to the `--tiger-*` global tokens. Only structural rules live
 * here.
 *
 * @package TigerElements
 */

/* ==========================================
   1. HOLDER & BASELINE VARIABLES
   ========================================== */

.tg-tp-wrap {
    --ghost-size: 50px;
    /* --pc-cols / --pc-gap come inline from the render and the JS settings.
       These are the desktop defaults if the inline ones aren't present. */
    --pc-cols: 3;
    --pc-cols-tablet: 2;
    --pc-cols-mobile: 1;
    --pc-gap: 30px;
    --pc-gap-tablet: 20px;
    --pc-gap-mobile: 10px;
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    z-index: 1;
    /* Arrow gutter so arrows sit outside the cards but inside the widget box — never clipped by an
       ancestor overflow:hidden (same model as the testimonial carousel). */
    --tc-arrow-gutter: 64px;
}

@media (min-width: 1025px) {
    .tg-tp-wrap {
        padding-left: var(--tc-arrow-gutter);
        padding-right: var(--tc-arrow-gutter);
    }
}

/* ==========================================
   2. PERSISTENT LAYOUT BASELINE
   ----------------------------------------------
   Mirrors TigerSwiper's own spacing mechanism. Applies ALWAYS — Swiper's
   inline styles take over once it inits. Eliminates 0-gap flash when the
   user changes Space-Between in the editor.
   ========================================== */

.tg-tp-cont .tiger-swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    will-change: transform;
}

.tg-tp-cont .tiger-swiper-slide {
    flex-shrink: 0;
    box-sizing: border-box;
    height: auto !important;
    width: calc((100% - (var(--pc-cols, 3) - 1) * var(--pc-gap, 30px)) / var(--pc-cols, 3));
    margin-right: var(--pc-gap, 30px);
}

.tg-tp-cont .tiger-swiper-slide:last-child {
    margin-right: 0;
}

/* ==========================================
   3. CAROUSEL CONTAINER & CARD
   ========================================== */

.tg-tp-cont {
    padding: 20px 0 60px 0 !important;
    overflow: hidden;
}

/* Equal Card Height toggle: OFF lets each slide size to its own content. */
.tg-tp-eqh-no .tg-tp-cont .tiger-swiper-slide { height: auto; align-self: flex-start; }
.tg-tp-eqh-no .tg-tp-card { height: auto; }

.tg-tp-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    margin: 5px 0;
    /* Clean default card chrome (full-bleed image on top, padded .tg-tp-inner below). All of these
       are overridable by the widget's own Style controls, so existing designs win. */
    background: #ffffff;
    border: 1px solid #eceef2;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.tg-tp-card:hover {
    border-color: #e2e5ea;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}

.tg-tp-card:hover {
    transform: translateY(-8px);
}

.tg-tp-badges {
    position: absolute !important;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
    transition: none !important;
}

.tg-tp-img {
    width: 100%;
    overflow: visible !important;
}

.tg-tp-img img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tg-tp-card:hover .tg-tp-img img {
    transform: scale(1.05);
}

.tg-tp-meta {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Button + icon layout — inline-flex so icon/text align and the user's
   Icon Gap control drives spacing via the `gap` property. */
.tg-tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tg-tp-btn-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.tg-tp-btn-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    display: block;
}

/* ==========================================
   4. NAVIGATION (GHOST STYLE)
   ========================================== */

.tg-tp-nav-prev,
.tg-tp-nav-next,
.tg-tp-pag {
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
    user-select: none;
}

.tg-tp-nav-prev,
.tg-tp-nav-next {
    position: absolute;
    /* Vertical centre + optional Y offset from the control. */
    top: calc(50% + var(--tc-arrow-y, 0px));
    width: var(--ghost-size);
    height: var(--ghost-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: translateY(-50%);
    /* Clean default look — white circular button, slate icon; overridable by the Nav Style controls. */
    background: #ffffff;
    color: #334155;
    border: 1px solid #eceef2;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.tg-tp-nav-prev svg, .tg-tp-nav-next svg { fill: currentColor; }

.tg-tp-nav-prev:hover,
.tg-tp-nav-next:hover {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.20);
}

/* Centred in the reserved gutter — outside the cards, never clipped. */
.tg-tp-nav-prev { left:  calc((var(--tc-arrow-gutter) - var(--ghost-size, 50px)) / 2); }
.tg-tp-nav-next { right: calc((var(--tc-arrow-gutter) - var(--ghost-size, 50px)) / 2); }

.tg-tp-nav-prev:after,
.tg-tp-nav-next:after {
    display: none !important;
}

/* ==========================================
   5. PAGINATION
   ========================================== */

.tg-tp-pag {
    position: relative;
    margin-top: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    line-height: 0;
}

.tg-tp-pag-bullet {
    width: 10px;
    height: 10px;
    opacity: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.tg-tp-pag-bullet-active {
    width: 25px;
    border-radius: 5px;
}

/* ==========================================
   6. GRID LAYOUT (alternate to carousel)
   ========================================== */

.tg-tp-grid {
    display: grid;
    grid-gap: var(--pc-gap, 30px);
    grid-template-columns: repeat(var(--pc-cols, 3), 1fr);
}

/* ==========================================
   7. RESPONSIVE
   ========================================== */

@media (max-width: 1300px) {
    .tg-tp-nav-prev { left: 4px; }
    .tg-tp-nav-next { right: 4px; }
}

@media (max-width: 1024px) {
    .tg-tp-wrap {
        --pc-cols: var(--pc-cols-tablet, 2);
        --pc-gap:  var(--pc-gap-tablet, 20px);
    }
}

@media (max-width: 767px) {
    .tg-tp-nav-prev,
    .tg-tp-nav-next {
        display: none;
    }
    .tg-tp-wrap {
        --pc-cols: var(--pc-cols-mobile, 1);
        --pc-gap:  var(--pc-gap-mobile, 10px);
    }
}
