/**
 * Published Media Section Styles - بخش مقالات منتشر شده
 * طراحی واکنش‌پذیر و بهینه
 */

:root {
    --pm-border-radius: 12px;
    --pm-transition-speed: 0.4s;
    --pm-accent-color: #667eea;
    --pm-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --pm-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.18);
}

/* ============================================
   SECTION WRAPPER
   ============================================ */

.published-media-section {
    position: relative;
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    overflow: hidden;
}

.published-media-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.darkmode .published-media-section {
    background: linear-gradient(135deg, #1a1d2a 0%, #2a2d3a 100%);
}

.published-media-section .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   SECTION HEADER
   ============================================ */

.published-media-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.published-media-section .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.darkmode .published-media-section .section-title {
    color: #e9ecef;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--pm-accent-color) 0%, #764ba2 100%);
    border-radius: 2px;
    margin: 0 auto;
    transition: width 0.3s ease;
}

.published-media-section:hover .title-underline {
    width: 120px;
}

/* ============================================
   CAROUSEL CONTAINER
   ============================================ */

.carousel-container {
    position: relative;
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.darkmode .carousel-container {
    background: rgba(42, 45, 58, 0.8);
    border-color: rgba(102, 126, 234, 0.2);
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 20px;
    margin-bottom: 30px;
    direction: rtl;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    will-change: transform;
    direction: ltr;
    o
}

.carousel-slide {
    flex: 0 0 100%;
    padding: 10px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
}

.carousel-slide.is-center .media-card {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 18px 48px rgba(102, 126, 234, 0.35), 0 0 0 3px rgba(102, 126, 234, 0.25);
    z-index: 2000;
    border: 5px solid #667eea;
}

@media (min-width: 1200px) {
    .carousel-slide.is-center .media-card {
        transform: translateY(-10px) scale(1.05);
        box-shadow: 0 22px 56px rgba(102, 126, 234, 0.4), 0 0 0 3px rgba(102, 126, 234, 0.3);
    }
}

/* ============================================
   MEDIA CARDS
   ============================================ */

.media-card {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: var(--pm-border-radius);
    overflow: hidden;
    box-shadow: var(--pm-shadow);
    transition: all var(--pm-transition-speed) cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.darkmode .media-card {
    background: #2a2d3a;
    border-color: rgba(255, 255, 255, 0.05);
}

.media-card:hover {
    box-shadow: var(--pm-shadow-hover);
    transform: translateY(-6px);
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    padding-bottom: 48%;
    overflow: visible;
    background: #ffffff;
    flex-shrink: 0;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.media-card:hover .card-image img {
    transform: none;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pm-accent-color) 0%, #764ba2 100%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 48px;
}

/* Card Body */
.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.4;
    transition: color var(--pm-transition-speed) ease;
    word-wrap: break-word;
}

.darkmode .card-title {
    color: #e9ecef;
}

.media-card:hover .card-title {
    color: var(--pm-accent-color);
}

/* Card Meta */
.card-meta {
    flex: 1;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    flex-direction: row-reverse;
}

.darkmode .meta-item {
    color: #adb5bd;
}

.meta-item i {
    color: var(--pm-accent-color);
    width: 16px;
    flex-shrink: 0;
    font-size: 13px;
}

/* Card Button */
.card-btn {
    display: inline-flex;
    color: white;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 9px 0px;
    background: linear-gradient(135deg, #2d3748 0%, #3498db 100%);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--pm-transition-speed) ease;
    width: 100%;
    direction: rtl;
}

.card-btn:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    transform: translateX(-3px);
    color: white;
    text-decoration: none;
}

.card-btn i {
    font-size: 12px;
    transition: transform var(--pm-transition-speed) ease;
}

.card-btn:hover i {
    transform: translateX(3px);
}

/* ============================================
   CAROUSEL CONTROLS - دکمه های کنترل
   ============================================ */

.carousel-btn {
    position: absolute;
    top: 100px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--pm-accent-color);
    color: var(--pm-accent-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pm-transition-speed) ease;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.darkmode .carousel-btn {
    background: #2a2d3a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-btn:hover {
    background: var(--pm-accent-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.carousel-btn-prev {
    left: auto;
    right: 10px;
}

.carousel-btn-next {
    right: auto;
    left: 10px;
}

/* Dots Navigation */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    transition: all var(--pm-transition-speed) ease;
    padding: 0;
}

.darkmode .carousel-dot {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-dot:hover {
    background: var(--pm-accent-color);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--pm-accent-color);
    width: 28px;
    border-radius: 5px;
}

/* ============================================
   RESPONSIVE DESIGN - طراحی واکنش‌پذیر
   ============================================ */

/* Desktop - 5 Items */
@media (min-width: 1200px) {
    .carousel-slide {
        flex: 0 0 20%;
        padding: 15px;
    }
    
    .carousel-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
    
    .published-media-section .section-title {
        font-size: 2.8rem;
    }
}

/* Laptop - 4 Items */
@media (min-width: 992px) and (max-width: 1199px) {
    .carousel-slide {
        flex: 0 0 25%;
        padding: 12px;
    }
    
    .published-media-section {
        padding: 70px 0;
    }
    
    .published-media-section .section-title {
        font-size: 2.4rem;
    }
}

/* Tablet - 3 Items */
@media (min-width: 768px) and (max-width: 991px) {
    .carousel-slide {
        flex: 0 0 33.333%;
        padding: 10px;
    }
    
    .carousel-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .published-media-section {
        padding: 60px 0;
    }
    
    .published-media-section .section-header {
        margin-bottom: 50px;
    }
    
    .published-media-section .section-title {
        font-size: 2.2rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .card-title {
        font-size: 16px;
    }
}

/* Small Tablet - 2 Items */
@media (min-width: 576px) and (max-width: 767px) {
    .carousel-slide {
        flex: 0 0 50%;
        padding: 10px;
    }
    
    .carousel-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .published-media-section {
        padding: 50px 0;
    }
    
    .published-media-section .section-header {
        margin-bottom: 40px;
    }
    
    .published-media-section .section-title {
        font-size: 2rem;
    }
    
    .carousel-container {
        padding: 15px;
    }
    
    .card-body {
        padding: 18px;
    }
    
    .card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .card-meta {
        margin-bottom: 12px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .card-btn {
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* Mobile - 1 Item */
@media (max-width: 575px) {
    .carousel-slide {
        flex: 0 0 100%;
        padding: 8px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
        border-width: 1px;
    }
    
    .carousel-btn-prev {
        left: auto;
        right: 5px;
    }

    .carousel-btn-next {
        right: auto;
        left: 5px;
    }
    
    .published-media-section {
        padding: 40px 0;
    }
    
    .published-media-section .section-header {
        margin-bottom: 30px;
    }
    
    .published-media-section .section-title {
        font-size: 1.8rem;
    }
    
    .carousel-container {
        padding: 12px;
        border-radius: 12px;
    }

    
    .card-body {
        padding: 16px;
    }
    
    .card-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .card-meta {
        margin-bottom: 10px;
        gap: 8px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .card-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .carousel-dots {
        gap: 6px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .carousel-dot.active {
        width: 24px;
    }
}

.carousel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Very Small Mobile */
@media (max-width: 375px) {
    .published-media-section {
        padding: 30px 0;
    }
    
    .published-media-section .section-title {
        font-size: 1.6rem;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .meta-item {
        font-size: 11px;
    }
    
    .card-btn {
        font-size: 11px;
    }
}

/* ============================================
   ACCESSIBILITY - دسترسی‌پذیری
   ============================================ */

.carousel-btn:focus,
.carousel-dot:focus {
    outline: 2px solid var(--pm-accent-color);
    outline-offset: 2px;
}

/* ============================================
   ANIMATIONS - انیمیشن‌ها
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-slide {
    animation: fadeIn 0.6s ease-out;
}

/* ============================================
   DARK MODE ADJUSTMENTS - تنظیمات حالت شب
   ============================================ */

.darkmode .media-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.darkmode .media-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}
