/**
 * Evoiii Gallery - Enhanced Independent CSS
 * Version: 2.0.0
 * Based on YouVideo theme but enhanced
 * Works with ANY theme - Light & Dark mode ready
 * Class prefix: evoiii-gallery-
 */

/* ============================================================
   WRAPPER & HEADER
   ============================================================ */
.evoiii-gallery-wrapper {
    max-width: 1360px;
    margin: 0 auto;
    padding: 15px 8px;
    /* الخلفية البيضاء معطلة - محفوظة للاستخدام المستقبلي */
    /* background: #ffffff; */
    /* الخلفية السوداء مفعلة */
    background: #181818;
    border-radius: 5px;
}

.evoiii-gallery-header {
    padding: 0 8px;
    margin-bottom: 15px;
}

.evoiii-gallery-title {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 5px 0;
    /* اللون الأسود معطل - محفوظ للاستخدام المستقبلي */
    /* color: #222; */
    /* اللون الأبيض مفعل */
    color: #ffffff;
}

/* ============================================================
   SUBTITLE - HIDDEN (Browse all hidden via CSS)
   ============================================================ */
.evoiii-gallery-subtitle {
    
}

/* ============================================================
   GRID - 4 Columns
   ============================================================ */
.evoiii-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 0 -8px;
}

/* ============================================================
   ITEM CARD
   ============================================================ */
.evoiii-gallery-item {
    padding: 0 8px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.evoiii-gallery-link {
    display: block;
    position: relative;
    line-height: 0.5;
    text-align: center;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
}

.evoiii-gallery-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

/* ============================================================
   THUMBNAIL - 16:9
   ============================================================ */
.evoiii-gallery-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #2b2b2b;
    overflow: hidden;
    line-height: 0.5;
    margin-bottom: 5px;
}

.evoiii-gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease-out 0s;
}

.evoiii-gallery-item:hover .evoiii-gallery-thumbnail img {
    transform: scale(1.1);
}

/* ============================================================
   BADGE (post count) - VISIBLE & LARGER
   ============================================================ */
.evoiii-gallery-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 4px;
    line-height: 1.4;
    z-index: 5;
    /* اللون الأسود معطل للاستخدام المستقبلي */
    /* color: #222; */
}

/* ============================================================
   PLAY BUTTON
   ============================================================ */
.evoiii-gallery-play {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 28px;
    height: 28px;
    line-height: 25px;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 5;
}

.evoiii-gallery-item:hover .evoiii-gallery-play {
    opacity: 1;
    visibility: visible;
}

.evoiii-gallery-play:hover {
    background: #d8201d;
}

.evoiii-gallery-play svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    vertical-align: middle;
}

/* ============================================================
   CONTENT - Title in center, larger, bold
   ============================================================ */
.evoiii-gallery-content {
    padding-top: 0;
    text-align: center;
}

.evoiii-gallery-item-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evoiii-gallery-item-title a {
    /* اللون الأسود معطل - محفوظ للاستخدام المستقبلي */
    /* color: #222 !important; */
    /* اللون الأبيض مفعل */
    color: #ffffff !important;
    text-decoration: none !important;
}

.evoiii-gallery-item-title a:hover {
    color: #d8201d !important;
    text-decoration: none !important;
}

/* ============================================================
   META (post count under title) - HIDDEN via CSS
   ============================================================ */
.evoiii-gallery-meta {
    
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.evoiii-gallery-empty {
    text-align: center;
    padding: 40px 0;
    color: #ccc;
    font-size: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 2 columns */
@media only screen and (min-width: 768px) and (max-width: 959px) {
    .evoiii-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media only screen and (max-width: 767px) {
    .evoiii-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .evoiii-gallery-wrapper {
        padding: 10px 4px;
    }
    
    .evoiii-gallery-item {
        padding: 0 4px;
    }
    
    .evoiii-gallery-title {
        font-size: 16px;
    }
    
    .evoiii-gallery-item-title {
        font-size: 16px;
    }
    
    .evoiii-gallery-badge {
        font-size: 14px;
        padding: 3px 10px;
        top: 8px;
        right: 8px;
    }
}

/* ============================================================
   DARK MODE - Active (background #181818)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    .evoiii-gallery-wrapper {
        background: #181818;
    }
    
    .evoiii-gallery-title {
        color: #ffffff;
    }
    
    .evoiii-gallery-item-title a {
        color: #ffffff !important;
    }
    
    .evoiii-gallery-item-title a:hover {
        color: #d8201d !important;
    }
    
    .evoiii-gallery-thumbnail {
        background: #2b2b2b;
    }
    
    .evoiii-gallery-empty {
        color: #ccc;
    }
    
    .evoiii-gallery-badge {
        background: rgba(0, 0, 0, 0.8);
        color: #ffffff;
    }
}

/* ============================================================
   LIGHT MODE - DISABLED (kept for future use)
   ============================================================ */
/*
@media (prefers-color-scheme: light) {
    .evoiii-gallery-wrapper {
        background: #ffffff;
    }
    
    .evoiii-gallery-title {
        color: #222;
    }
    
    .evoiii-gallery-item-title a {
        color: #222 !important;
    }
    
    .evoiii-gallery-item-title a:hover {
        color: #d8201d !important;
    }
    
    .evoiii-gallery-thumbnail {
        background: #e0e0e0;
    }
    
    .evoiii-gallery-empty {
        color: #666;
    }
    
    .evoiii-gallery-badge {
        background: rgba(0, 0, 0, 0.75);
        color: #fff;
    }
}
*/

/* ============================================================
   REUSABLE - For related posts, etc.
   ============================================================ */
.evoiii-gallery-related .evoiii-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media only screen and (max-width: 959px) {
    .evoiii-gallery-related .evoiii-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 767px) {
    .evoiii-gallery-related .evoiii-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.evoiii-gallery-text-center {
    text-align: center;
}

.evoiii-gallery-mb-20 {
    margin-bottom: 20px;
}

.evoiii-gallery-mt-20 {
    margin-top: 20px;
}

.evoiii-gallery-p-20 {
    padding: 20px;
}

.evoiii-gallery-clearfix:after {
    content: '';
    display: table;
    clear: both;
}

/* ============================================================
   PAGINATION
   ------------------------------------------------------------
   Default styling modeled after the theme's own pagination look
   (numbered boxes, red current page, dark "Next" button). If you
   send over the theme's pagination CSS this can be refined to
   match pixel-for-pixel.
   ============================================================ */
.evoiii-gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 25px 0 10px;
    padding: 0 8px;
}

.evoiii-gallery-pagination a,
.evoiii-gallery-pagination span.evoiii-gallery-page-num,
.evoiii-gallery-pagination .evoiii-gallery-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #2b2b2b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    border-radius: 3px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.evoiii-gallery-pagination a:hover,
.evoiii-gallery-pagination .evoiii-gallery-next:hover {
    background: #3a3a3a;
    color: #ffffff !important;
}

.evoiii-gallery-pagination .evoiii-gallery-page-num.current {
    background: #d8201d;
    color: #ffffff;
    cursor: default;
}

.evoiii-gallery-pagination .evoiii-gallery-page-dots {
    color: #888;
    padding: 0 6px;
    font-weight: 700;
}

@media only screen and (max-width: 767px) {
    .evoiii-gallery-pagination a,
    .evoiii-gallery-pagination span.evoiii-gallery-page-num,
    .evoiii-gallery-pagination .evoiii-gallery-next {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
    }
}