/**
 * TT Post Styles
 *
 * @package TT_Flux_Addon
 * @since 1.2.3
 */

.tt-post,
.tt-post *,
.tt-post *::before,
.tt-post *::after {
    box-sizing: border-box;
}

.tt-post {
    width: 100%;
}

.tt-post__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.tt-post--slider {
    position: relative;
}

.tt-post__slider {
    overflow: hidden;
}

.tt-post__slider-wrapper {
    align-items: stretch;
}

.tt-post__slide {
    display: flex;
    height: auto;
}

.tt-post__slide .tt-post__card {
    width: 100%;
}

.tt-post__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.tt-post--equal-height .tt-post__card {
    height: 100%;
}

.tt-post__card:hover {
    transform: translateY(-3px);
    border-color: #d7dce3;
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.12);
}

.tt-post__image-link,
.tt-post__placeholder {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 64%;
    overflow: hidden;
    background: #f1f3f6;
    text-decoration: none;
}

.tt-post__image-link::after,
.tt-post__placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.18) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tt-post__card:hover .tt-post__image-link::after,
.tt-post__card:hover .tt-post__placeholder::after {
    opacity: 1;
}

.tt-post__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.tt-post__card:hover .tt-post__image {
    transform: scale(1.05);
}

.tt-post--no-image-scale .tt-post__card:hover .tt-post__image {
    transform: none;
}

.tt-post__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
}

.tt-post__badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #0f766e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.tt-post__badge:hover {
    color: #ffffff;
}

.tt-post__title {
    width: 100%;
    margin: 0 0 12px;
    color: #111827;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
}

.tt-post__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tt-post__title a:hover {
    color: #0f766e;
}

.tt-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    width: 100%;
    margin-bottom: 14px;
    color: #667085;
    font-size: 13px;
    line-height: 1.4;
}

.tt-post__meta-item {
    position: relative;
}

.tt-post__meta-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -7px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
    opacity: 0.45;
}

.tt-post__excerpt {
    width: 100%;
    margin-bottom: 20px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
}

.tt-post__read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: auto;
    padding: 10px 16px;
    border-radius: 6px;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tt-post__read-more:hover {
    background: #0f766e;
    color: #ffffff;
    transform: translateY(-1px);
}

.tt-post__empty {
    padding: 20px;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    color: #667085;
    text-align: center;
}

.tt-post__arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #e6e8ec;
    border-radius: 50%;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 24, 40, 0.14);
    transform: translateY(-50%);
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.tt-post__arrow span {
    display: block;
    margin-top: -2px;
    font-size: 30px;
    line-height: 1;
}

.tt-post__arrow:hover {
    background: #111827;
    color: #ffffff;
}

.tt-post__arrow--prev {
    left: -21px;
}

.tt-post__arrow--next {
    right: -21px;
}

.tt-post__arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
}

.tt-post__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.tt-post__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d0d5dd;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tt-post__dot.active {
    background: #111827;
    transform: scale(1.2);
}

/* Style 2: Overlay Card */
.tt-post--style-2 .tt-post__card {
    min-height: 360px;
    border: 0;
    background: #111827;
}

.tt-post--style-2 .tt-post__image-link,
.tt-post--style-2 .tt-post__placeholder {
    position: absolute;
    inset: 0;
    height: 100%;
    padding-bottom: 0;
}

.tt-post--style-2 .tt-post__image-link::after,
.tt-post--style-2 .tt-post__placeholder::after {
    opacity: 1;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.08) 0%, rgba(17, 24, 39, 0.88) 100%);
}

.tt-post--style-2 .tt-post__content {
    position: relative;
    z-index: 2;
    justify-content: flex-end;
    min-height: 360px;
    padding: 28px;
}

.tt-post--style-2 .tt-post__badge {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
}

.tt-post--style-2 .tt-post__title a,
.tt-post--style-2 .tt-post__meta,
.tt-post--style-2 .tt-post__excerpt {
    color: #ffffff;
}

.tt-post--style-2 .tt-post__excerpt,
.tt-post--style-2 .tt-post__meta {
    opacity: 0.86;
}

.tt-post--style-2 .tt-post__read-more {
    background: #ffffff;
    color: #111827;
}

.tt-post--style-2 .tt-post__read-more:hover {
    background: #0f766e;
    color: #ffffff;
}

/* Style 3: Minimal List */
.tt-post--style-3 .tt-post__grid {
    grid-template-columns: 1fr;
}

.tt-post--style-3 .tt-post__card {
    display: grid;
    grid-template-columns: minmax(160px, 32%) minmax(0, 1fr);
    align-items: stretch;
    border: 0;
    border-bottom: 1px solid #e6e8ec;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.tt-post--style-3 .tt-post__card:hover {
    transform: none;
    border-color: #d7dce3;
    box-shadow: none;
}

.tt-post--style-3 .tt-post__image-link,
.tt-post--style-3 .tt-post__placeholder {
    height: 100%;
    min-height: 180px;
    padding-bottom: 0;
    border-radius: 8px;
}

.tt-post--style-3 .tt-post__content {
    padding: 8px 0 24px 24px;
}

.tt-post--style-3 .tt-post__title {
    font-size: 24px;
}

.tt-post--style-3 .tt-post__read-more {
    padding: 0;
    min-height: auto;
    border-radius: 0;
    background: transparent;
    color: #0f766e;
}

.tt-post--style-3 .tt-post__read-more:hover {
    background: transparent;
    color: #111827;
}

/* Style 4: Magazine Grid */
.tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child {
    grid-column: span 2;
}

.tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child .tt-post__title {
    font-size: 30px;
}

.tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child .tt-post__image-link,
.tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child .tt-post__placeholder {
    padding-bottom: 56%;
}

@media (max-width: 1024px) {
    .tt-post__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tt-post__grid {
        grid-template-columns: 1fr;
    }

    .tt-post__content {
        padding: 20px;
    }

    .tt-post__title {
        font-size: 20px;
    }

    .tt-post--style-2 .tt-post__card,
    .tt-post--style-2 .tt-post__content {
        min-height: 320px;
    }

    .tt-post--style-3 .tt-post__card {
        grid-template-columns: 1fr;
    }

    .tt-post--style-3 .tt-post__image-link,
    .tt-post--style-3 .tt-post__placeholder {
        min-height: 0;
        padding-bottom: 58%;
    }

    .tt-post--style-3 .tt-post__content {
        padding: 18px 0 24px;
    }

    .tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child {
        grid-column: auto;
    }

    .tt-post--grid.tt-post--style-4 .tt-post__grid > .tt-post__card:first-child .tt-post__title {
        font-size: 22px;
    }

    .tt-post__arrow {
        width: 36px;
        height: 36px;
    }

    .tt-post__arrow--prev {
        left: 8px;
    }

    .tt-post__arrow--next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tt-post__card,
    .tt-post__image,
    .tt-post__read-more,
    .tt-post__title a {
        transition: none;
    }

    .tt-post__card:hover,
    .tt-post__card:hover .tt-post__image,
    .tt-post__read-more:hover {
        transform: none;
    }
}

[dir="rtl"] .tt-post__meta-item:not(:last-child)::after {
    right: auto;
    left: -7px;
}

[dir="rtl"] .tt-post--style-3 .tt-post__content {
    padding-right: 24px;
    padding-left: 0;
}

@media (max-width: 767px) {
    [dir="rtl"] .tt-post--style-3 .tt-post__content {
        padding-right: 0;
    }
}

/* ==========================================================================
   Grid Pagination
   ========================================================================== */

/* Pages Container */
.tt-post__pages {
    position: relative;
}

/* Individual Page */
.tt-post__page {
    display: none;
}

.tt-post__page--active {
    display: block;
}

.tt-post__page--measuring {
    display: block !important;
}

/* Pagination Navigation Bar */
.tt-post__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e6e8ec;
    font-size: 14px;
    user-select: none;
}

/* Previous / Next Buttons */
.tt-post__pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.tt-post__pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tt-post__pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Page Number Container */
.tt-post__pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Individual Page Number */
.tt-post__pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tt-post__pagination-page:hover {
    background: #f3f4f6;
    color: #374151;
}

.tt-post__pagination-page--active {
    color: #0f766e;
    border-color: #0f766e;
    background: #f0fdfa;
    font-weight: 600;
    cursor: default;
}

/* Ellipsis (…) when pages are truncated */
.tt-post__pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: default;
    pointer-events: none;
}
