/* CMS Common Styles - Shared across all CMS templates */

/* Aspect Ratio Utilities */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio = 9/16 = 0.5625 */
}

.aspect-w-9 {
    position: relative;
    padding-bottom: 177.78%;
    /* 9:16 ratio = 16/9 = 1.7778 */
}

.aspect-w-16>img,
.aspect-w-16>video,
.aspect-w-16>iframe,
.aspect-w-16>picture,
.aspect-w-16>picture>img,
.aspect-w-16>.fallback-gradient,
.aspect-w-9>img,
.aspect-w-9>video,
.aspect-w-9>iframe,
.aspect-w-9>picture,
.aspect-w-9>picture>img,
.aspect-w-9>.fallback-gradient {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    object-fit: cover;
}

/* Line Clamp Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Card Hover Effect */
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Filter Button Styles */
.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn-active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.filter-btn-inactive {
    background-color: #f3f4f6;
    color: #374151;
}

.filter-btn-inactive:hover {
    background-color: #e5e7eb;
}

/* Filter Tabs Carousel - Mobile (< 640px), CSP-compliant (no inline styles) */
.filter-tabs-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.filter-tabs-container .filter-row-1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.filter-tabs-container .filter-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    margin-top: 0.5rem;
}

.filter-tabs-container .filter-carousel-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.filter-tabs-container .filter-carousel-fade-left {
    left: 0;
    background: linear-gradient(to right, var(--filter-carousel-fade-bg, #fff) 0%, transparent 100%);
}

.filter-tabs-container .filter-carousel-fade-right {
    right: 0;
    background: linear-gradient(to left, var(--filter-carousel-fade-bg, #fff) 0%, transparent 100%);
}

.filter-tabs-container .filter-carousel-fade.visible {
    opacity: 1;
}

.filter-tabs-container .filter-carousel-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}

.filter-tabs-container .filter-carousel-container::-webkit-scrollbar {
    display: none;
}

.filter-tabs-container .filter-carousel-track {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
    will-change: transform;
    width: max-content;
}

.filter-tabs-container .filter-carousel-item {
    flex-shrink: 0;
}

.filter-tabs-container .filter-sort-wrapper {
    margin-left: auto;
    flex-shrink: 1;
    min-width: 0;
}

@media (min-width: 640px) {
    .filter-tabs-container .filter-row-1 {
        margin-bottom: 0;
    }

    .filter-tabs-container .filter-sort-wrapper {
        margin-left: auto;
    }
}

#downloads-main-content.downloads-main-content-loading {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#blog-main-content.cms-partial-loading,
#docs-main-content.cms-partial-loading,
#downloads-main-content.cms-partial-loading {
    opacity: 0.94;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Banner Card Wrapper */
.banner-card {
    background-color: white;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.banner-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Docs Post Styles */
.docs-post {
    transition: all 0.3s;
}

.docs-post.hidden {
    display: none;
}

.docs-post.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ========== Downloads Page (02-frontend: no inline styles; 06-typography: ≥12px) ========== */
.downloads-layout .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 1.25rem;
    vertical-align: middle;
}

.download-card {
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
    transition: all 0.2s ease-in-out;
}

.download-card:hover {
    box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.12);
    transform: translateY(-2px);
}

.downloads-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .downloads-layout {
        grid-template-columns: 1fr 280px;
    }
}

.download-card .material-symbols-outlined.icon-thumb {
    font-size: 2.5rem;
}

.download-card .material-symbols-outlined.icon-meta {
    font-size: var(--font-size-xs, 0.75rem);
}

.download-card .material-symbols-outlined.icon-btn,
.download-card .material-symbols-outlined.icon-btn-inline {
    font-size: var(--icon-size-sm, 0.875rem);
    vertical-align: middle;
    margin-right: 0.25rem;
}

.downloads-empty-state .material-symbols-outlined.icon-empty {
    font-size: 3rem;
}

.download-category-badge {
    font-size: var(--font-size-xs, 0.75rem);
}

#downloads-sidebar .material-symbols-outlined.icon-size-18 {
    font-size: 1.125rem;
}

#downloads-sidebar .material-symbols-outlined.icon-size-20 {
    font-size: 1.25rem;
}

/* ===== Unified Pagination Component ===== */
.unified-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    margin-top: 2rem;
}

.pg-num,
.pg-nav {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-gray-200, #e2e8f0);
    border-radius: 10px;
    color: var(--color-gray-500, #64748b);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pg-nav svg {
    width: 20px;
    height: 20px;
}

.pg-num:hover {
    background: linear-gradient(135deg, #9333ea 0%, #3b82f6 100%);
    border-color: transparent;
    color: #fff;
}

.pg-nav:hover {
    background: var(--color-gray-100, #f1f5f9);
}

.pg-num.is-active {
    background: linear-gradient(135deg, #9333ea 0%, #3b82f6 100%);
    border-color: transparent;
    color: #fff;
    cursor: default;
    pointer-events: none;
}

.pg-nav.is-disabled {
    color: var(--color-gray-400, #94a3b8);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pg-ellipsis {
    padding: 0 0.25rem;
    color: var(--color-gray-400, #94a3b8);
    font-weight: 600;
    user-select: none;
}

@media (max-width: 640px) {
    .unified-pagination {
        gap: 0.25rem;
    }

    .pg-num,
    .pg-nav {
        width: 36px;
        height: 36px;
        font-size: 0.8125rem;
    }

    .pg-nav svg {
        width: 18px;
        height: 18px;
    }
}

/* Stats Counter styles moved to premium_blocks.css */
