/**
 * Media Posts Carousel Styles
 * Teeno Theme — MashhorHub
 * Extracted from functions.php for cache-ability and clean architecture.
 */

/* ===== Carousel Container ===== */
.teeno-media-posts-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0;
    overflow: hidden;
}

/* ===== Carousel Track ===== */
.teeno-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

/* ===== Single Slide / Card ===== */
.teeno-media-post {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    flex: 0 0 100%;
    margin: 0 15px;
    min-width: 300px;
}

/* Multi-item carousel widths */
.teeno-carousel-multi .teeno-media-post {
    flex: 0 0 calc(33.333% - 30px);
}

.teeno-carousel-2-items .teeno-media-post {
    flex: 0 0 calc(50% - 30px);
}

.teeno-carousel-4-items .teeno-media-post {
    flex: 0 0 calc(25% - 30px);
}

.teeno-media-post:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ===== Media Container (Video / Image) ===== */
.teeno-media-post-video,
.teeno-media-post-image {
    position: relative;
    width: 100%;
    padding-top: 65%; /* ~16:10 aspect ratio */
    overflow: hidden;
    background-color: #f5f5f5;
}

.teeno-media-post-video::before,
.teeno-media-post-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.teeno-media-post:hover .teeno-media-post-video::before,
.teeno-media-post:hover .teeno-media-post-image::before {
    opacity: 1;
}

.teeno-media-post-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teeno-media-post-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.teeno-media-post:hover .teeno-media-post-image img {
    transform: scale(1.08);
}

/* ===== Category Badge ===== */
.teeno-media-post-category {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 30px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: teeno-gradient-shift 3s ease infinite, teeno-pulse 2s infinite alternate;
}

@keyframes teeno-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes teeno-pulse {
    0%   { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); }
    100% { box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4); }
}

.teeno-media-post-category:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

/* ===== Meta Info ===== */
.teeno-media-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.teeno-media-post-meta .category-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.teeno-media-post-meta .category-tag i {
    font-size: 11px;
}

.teeno-media-post-meta .category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== Author ===== */
.teeno-media-post-author {
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
}

.teeno-media-post-author::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #007bff;
    border-radius: 50%;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 10px;
}

/* ===== Content Area ===== */
.teeno-media-post-content {
    padding: 25px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 250px;
}

/* ===== Title ===== */
.teeno-media-post-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.teeno-media-post-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--color-primary, #007bff);
    transition: width 0.3s ease;
}

.teeno-media-post:hover .teeno-media-post-title::after {
    width: 80px;
}

.teeno-media-post-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.teeno-media-post-title a:hover {
    color: var(--color-primary, #007bff);
}

/* ===== Excerpt ===== */
.teeno-media-post-excerpt {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

/* ===== Read More Button ===== */
.teeno-media-post-readmore {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--color-primary, #007bff);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: background-color 0.3s ease, transform 0.3s ease;
    align-self: flex-start;
    margin-top: auto;
}

.teeno-media-post-readmore:hover {
    background-color: #333;
    color: #fff;
    transform: translateY(-2px);
}

/* ===== Image Overlay ===== */
.teeno-media-post-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 123, 255, 0.8), rgba(0, 86, 179, 0.8));
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.teeno-media-post-overlay-content {
    text-align: center;
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
}

.teeno-media-post-overlay-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.teeno-media-post-overlay-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.teeno-media-post:hover .teeno-media-post-overlay {
    opacity: 1;
}

.teeno-media-post:hover .teeno-media-post-overlay-content {
    transform: translateY(0);
    opacity: 1;
}

/* ===== Social Icons on Card ===== */
.teeno-media-post-social-links {
    display: flex;
    gap: 8px;
    padding: 15px 25px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.teeno-media-post-social-links a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.teeno-media-post-social-links a:hover {
    background-color: var(--color-primary, #007bff);
    color: #fff;
    transform: translateY(-3px);
}

/* ===== Carousel Navigation Arrows ===== */
.teeno-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
    color: #333;
}

.teeno-carousel-arrow:hover {
    background-color: var(--color-primary, #007bff);
    color: #fff;
}

.teeno-carousel-prev { left: 20px; }
.teeno-carousel-next { right: 20px; }

/* ===== Carousel Dots ===== */
.teeno-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.teeno-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.teeno-carousel-dot.active {
    background-color: var(--color-primary, #007bff);
    transform: scale(1.2);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .teeno-carousel-multi .teeno-media-post {
        flex: 0 0 calc(50% - 30px);
    }

    .teeno-carousel-4-items .teeno-media-post {
        flex: 0 0 calc(33.333% - 30px);
    }
}

@media (max-width: 767px) {
    .teeno-carousel-multi .teeno-media-post,
    .teeno-carousel-2-items .teeno-media-post,
    .teeno-carousel-4-items .teeno-media-post {
        flex: 0 0 calc(100% - 30px);
    }

    .teeno-media-post-title {
        font-size: 18px;
    }

    .teeno-carousel-arrow {
        width: 40px;
        height: 40px;
    }
}
