/* public/css/posts-table.css */

html, body{
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #f8fafc;
}

/* Header */
.stats{
    background: linear-gradient(135deg, #008080 0%, #008080 100%);
    color: #fff;
    padding: 20px 40px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}
.stats h1{
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Content area */
.posts-wrap{
    padding: 24px 16px;
}

/* Grid centered */
#postsGrid{
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}
@media (min-width: 900px){
    #postsGrid{ grid-template-columns: 1fr 1fr; }
}

.post-card{
    --padx: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px var(--padx) 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    box-sizing: border-box;
}

/* text */
.post-text{
    white-space: pre-line;
    word-break: break-word;
    line-height: 1.6;
    font-size: 16px;
    color: #111827;
    margin-bottom: 10px;
}

/* collapsed state */
.post-text.is-collapsed{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: var(--clamp, 6);
}

.see-more-btn{
    border: 0;
    background: transparent;
    color: #008080;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    margin: 0 0 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.see-more-btn:hover{ text-decoration: underline; }

.post-meta{
    font-family: monospace;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

/* ===== Carousel (images) ===== */
.carousel{
    margin-bottom: 12px;
    position: relative;
}

.carousel-track{
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overflow-y: hidden;
}
.carousel-track::-webkit-scrollbar{ display: none; }

.carousel-slide{
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: block;
    height: auto;
    text-decoration: none;
    color: inherit;
    outline: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.carousel-slide:focus,
.carousel-slide:focus-visible{
    outline:none !important;
}

.carousel-img{
    width: 100%;
    height: 360px;
    display: block;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.carousel-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 0;
    background: rgba(0,0,0,0.45);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.carousel-btn.prev{ left: 10px; }
.carousel-btn.next{ right: 10px; }

/* ===== Inline Video ===== */
.video-wrap{
    position: relative;
    background: #000;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-player{
    width: 100%;
    height: 360px;
    display: block;
    background: #000;
    object-fit: cover;
}

.video-empty{
    width: 100%;
    height: 360px;
    display: grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-weight: 700;
    opacity: .9;
}

/* ===== Pagination ===== */
.pagination-custom{
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    padding: 12px 24px;
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-custom button{
    width: 44px;
    height: 44px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;

}

.pagination-custom button:hover:not(:disabled){
    background: linear-gradient(135deg, #008080 0%, #008080 100%);
    color: #fff;
    border-color: transparent;
}

.pagination-custom button:disabled{ opacity: 0.3; cursor: not-allowed; }

.pagination-custom .active{
    width: auto;
    min-width: 48px;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #008080 0%, #008080 100%);
    color: #fff !important;
}

/* Disable pagination while loading */
.pagination-custom.is-loading{
    opacity: .85;
}

/* ===== Lightbox ===== */
.img-lightbox{
    display:none;
    position:fixed;
    inset:0;
    z-index:99999;
    background:rgba(0,0,0);
    align-items:center;
    justify-content:center;
    padding:24px;
}
.img-lightbox.open{ display:flex; }

#imgLightboxImg{
    max-width:min(92vw, 1100px);
    max-height:90vh;
    border-radius:14px;
    box-shadow:0 10px 40px rgba(0,0,0,0%);
}

.img-lightbox-close{
    position:absolute;
    top:12px;
    right:16px;
    border:0;
    background:transparent;
    color:#fff;
    font-size:40px;
    cursor:pointer;
    line-height:1;
}

.img-lightbox-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    border:0;
    color:#fff;
    font-size:44px;
    width:54px;
    height:54px;
    border-radius:999px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    backdrop-filter: blur(6px);
}

.img-lightbox-nav.prev{ left:16px; }
.img-lightbox-nav.next{ right:16px; }

.img-lightbox-nav[disabled]{
    opacity:.35;
    cursor:default;
}

/* ===== Filters ===== */
.filters{
    max-width: 1100px;
    margin: 0 auto 14px auto;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.filters-row{
    display:flex;
    gap:10px;
    align-items:end;
    flex-wrap:wrap;
}

.filters label{
    display:flex;
    flex-direction:column;
    gap:6px;
    font-size:13px;
    color:#374151;
    font-weight:700;
}

.filters input[type="date"]{
    height: 40px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-weight: 700;
    color:#111827;
}

.btn-filter{
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 0;
    background: #008080;
    color:#fff;
    font-weight: 800;
    cursor:pointer;
}
.btn-filter.secondary{ background:#111827; }
.btn-filter:disabled{ opacity:.45; cursor:not-allowed; }

/* ===== Empty state ===== */
.empty-state{
    max-width: 1100px;
    margin: 16px auto;
    padding: 22px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    text-align: center;
}
.empty-title{ font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.empty-sub{ opacity: .75; }

/* ===== Skeleton cards ===== */
.card-skeleton{
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.skel-line{
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.10), rgba(0,0,0,.06));
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

.skel-line.w60{ width: 60%; }
.skel-line.w80{ width: 80%; }
.skel-line.w40{ width: 40%; }

.skel-img{
    height: 360px;
    border-radius: 14px;
    margin-top: 14px;
    background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.10), rgba(0,0,0,.06));
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer { 0%{background-position:0 0} 100%{background-position:-200% 0} }

@media (max-width: 768px){
    .stats, .pagination-custom{ padding-left: 16px; padding-right: 16px; }
    .carousel-img{ height: 280px; }
    .video-player, .video-empty{ height: 280px; }
}

/* Overlay exists in DOM but unused */
.posts-overlay{ display:none !important; }

/* Kill legacy loader always */
#pageLoader{ display:none !important; }
.loading-global{ display:none !important; }