/* 
 * TED Platform Main Styles - Fixed Version
 * Professional TED-inspired design with centered headers and proper grid display
 */

:root {
    /* TED Color System */
    --ted-primary: #e62b1e;
    --ted-primary-dark: #cc0000;
    --ted-primary-light: #ff4d3d;
    --ted-black: #000000;
    --ted-gray-900: #1a1a1a;
    --ted-gray-800: #333333;
    --ted-gray-700: #4d4d4d;
    --ted-gray-600: #666666;
    --ted-gray-500: #808080;
    --ted-gray-400: #999999;
    --ted-gray-300: #b3b3b3;
    --ted-gray-200: #cccccc;
    --ted-gray-100: #e6e6e6;
    --ted-gray-50: #f5f5f5;
    --ted-white: #ffffff;
    
    /* Typography */
    --ted-font-primary: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --ted-font-heading: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Spacing */
    --ted-space-xs: 0.5rem;
    --ted-space-sm: 1rem;
    --ted-space-md: 1.5rem;
    --ted-space-lg: 2rem;
    --ted-space-xl: 3rem;
    --ted-space-2xl: 4rem;
    
    /* Border Radius */
    --ted-radius-sm: 0.5rem;
    --ted-radius-md: 0.75rem;
    --ted-radius-lg: 1rem;
    --ted-radius-xl: 1.5rem;
    
    /* Shadows */
    --ted-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ted-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ted-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ted-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ted-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Animations */
    --ted-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ted-duration: 0.3s;
}

/* Reset and Base Styles */
.ted-platform {
    font-family: var(--ted-font-primary);
    line-height: 1.6;
    color: var(--ted-gray-800);
    background: var(--ted-white);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Container Alignment - FIXED */
.ted-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Hide Astra default header/footer */
.site-header, 
.site-footer,
header.site-header,
footer.site-footer {
    display: none !important;
}

/* Header Styles */
.ted-custom-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ted-gray-100);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all var(--ted-duration) var(--ted-ease);
}

.ted-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.ted-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
}

.ted-logo-main {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ted-primary);
    letter-spacing: -0.02em;
}

.ted-logo-sub {
    font-size: 0.75rem;
    color: var(--ted-gray-600);
    font-weight: 500;
}

.ted-main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.ted-main-nav a {
    text-decoration: none;
    color: var(--ted-gray-700);
    font-weight: 500;
    transition: all var(--ted-duration) var(--ted-ease);
    padding: 0.5rem 1rem;
    border-radius: var(--ted-radius-md);
}

.ted-main-nav a:hover {
    color: var(--ted-primary);
    background: var(--ted-gray-50);
    transform: translateY(-1px);
}

.ted-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Button Styles */
.ted-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--ted-radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ted-duration) var(--ted-ease);
    cursor: pointer;
    font-size: 0.875rem;
}

.ted-btn-primary {
    background: var(--ted-primary);
    color: var(--ted-white);
}

.ted-btn-primary:hover {
    background: var(--ted-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--ted-shadow-lg);
}

.ted-btn-outline {
    background: transparent;
    color: var(--ted-gray-700);
    border: 2px solid var(--ted-gray-300);
}

.ted-btn-outline:hover {
    border-color: var(--ted-primary);
    color: var(--ted-primary);
    transform: translateY(-2px);
}

.ted-btn-login {
    background: transparent;
    color: var(--ted-gray-700);
}

.ted-btn-login:hover {
    color: var(--ted-primary);
    background: var(--ted-gray-50);
}

.ted-btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.ted-btn-glow {
    box-shadow: 0 0 20px rgba(230, 43, 30, 0.3);
}

.ted-btn-glow:hover {
    box-shadow: 0 0 30px rgba(230, 43, 30, 0.5);
}

/* Hero Section */
.ted-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.ted-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff" fill-opacity="0.1" points="0,1000 1000,0 1000,1000"/></svg>');
}

.ted-hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ted-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.ted-particle:nth-child(1) {
    width: 20px;
    height: 20px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.ted-particle:nth-child(2) {
    width: 15px;
    height: 15px;
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.ted-particle:nth-child(3) {
    width: 25px;
    height: 25px;
    top: 40%;
    left: 40%;
    animation-delay: 2s;
}

.ted-particle:nth-child(4) {
    width: 18px;
    height: 18px;
    top: 80%;
    left: 20%;
    animation-delay: 3s;
}

.ted-particle:nth-child(5) {
    width: 22px;
    height: 22px;
    top: 30%;
    left: 70%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.ted-hero-content {
    position: relative;
    z-index: 2;
    color: var(--ted-white);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.ted-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--ted-space-lg);
}

.ted-title-line {
    display: block;
}

.ted-accent {
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.ted-hero-description {
    font-size: 1.25rem;
    margin-bottom: var(--ted-space-xl);
    opacity: 0.9;
    line-height: 1.6;
}

.ted-hero-actions {
    display: flex;
    gap: var(--ted-space-md);
    justify-content: center;
    margin-bottom: var(--ted-space-2xl);
}

.ted-hero-stats {
    display: flex;
    gap: var(--ted-space-2xl);
    justify-content: center;
}

.ted-stat {
    text-align: center;
}

.ted-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffd700;
    margin-bottom: var(--ted-space-xs);
}

.ted-stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ted-hero-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.1;
}

.ted-hero-graphic {
    position: relative;
    width: 400px;
    height: 400px;
}

.ted-graphic-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 3s ease-in-out infinite;
}

.ted-circle-1 {
    width: 300px;
    height: 300px;
    animation-delay: 0s;
}

.ted-circle-2 {
    width: 200px;
    height: 200px;
    animation-delay: 1s;
}

.ted-circle-3 {
    width: 100px;
    height: 100px;
    animation-delay: 2s;
}

.ted-graphic-main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ted-play-icon {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Section Styles - FIXED: Center alignment */
.ted-section {
    padding: var(--ted-space-xl) 0; /* ???? padding ?????? */
    width: 100%;
}

/* FIXED: Section Header - Centered */
.ted-section-header {
    text-align: center;
    margin-bottom: var(--ted-space-lg); /* ???? ????? */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ted-section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ted-gray-900);
    margin-bottom: var(--ted-space-sm);
    text-align: center;
    width: 100%;
}

.ted-section-subtitle {
    font-size: 1.125rem;
    color: var(--ted-gray-600);
    margin-bottom: var(--ted-space-lg);
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.ted-section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ted-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--ted-duration) var(--ted-ease);
    text-align: center;
    margin: 0 auto;
}

.ted-section-link:hover {
    gap: 0.75rem;
    color: var(--ted-primary-dark);
}

/* Latest Videos Grid - FIXED: Centered and proper grid display */
.ted-latest-videos .ted-latest-grid {
    display: grid;
    gap: var(--ted-space-lg);
    margin-bottom: var(--ted-space-xl);
    width: 100%;
    justify-items: center;
}

/* FIXED: Responsive grid based on data attributes - Centered */
.ted-latest-grid[data-columns="2"] { 
    grid-template-columns: repeat(2, 1fr); 
}
.ted-latest-grid[data-columns="3"] { 
    grid-template-columns: repeat(3, 1fr); 
}
.ted-latest-grid[data-columns="4"] { 
    grid-template-columns: repeat(4, 1fr); 
}
.ted-latest-grid[data-columns="5"] { 
    grid-template-columns: repeat(5, 1fr); 
}
.ted-latest-grid[data-columns="6"] { 
    grid-template-columns: repeat(6, 1fr); 
}

/* Videos Grid - FIXED: Centered and proper grid display */
.ted-videos-grid {
    display: grid;
    gap: var(--ted-space-lg);
    width: 100%;
    justify-items: center;
}

/* FIXED: Grid layouts with centered alignment */
.ted-videos-grid[data-layout="grid"] {
    grid-template-columns: repeat(var(--columns, 4), 1fr);
}

.ted-videos-grid[data-layout="grid"][data-columns="1"] { 
    grid-template-columns: repeat(1, 1fr); 
}
.ted-videos-grid[data-layout="grid"][data-columns="2"] { 
    grid-template-columns: repeat(2, 1fr); 
}
.ted-videos-grid[data-layout="grid"][data-columns="3"] { 
    grid-template-columns: repeat(3, 1fr); 
}
.ted-videos-grid[data-layout="grid"][data-columns="4"] { 
    grid-template-columns: repeat(4, 1fr); 
}
.ted-videos-grid[data-layout="grid"][data-columns="5"] { 
    grid-template-columns: repeat(5, 1fr); 
}
.ted-videos-grid[data-layout="grid"][data-columns="6"] { 
    grid-template-columns: repeat(6, 1fr); 
}

/* Video Card Styles - FIXED: Reduced height and better proportions */
.ted-video-card {
    background: var(--ted-white);
    border-radius: var(--ted-radius-lg); /* ???? radius */
    overflow: hidden;
    box-shadow: var(--ted-shadow-md); /* ???? ???? */
    transition: all var(--ted-duration) var(--ted-ease);
    position: relative;
    width: 100%;
    max-width: 280px; /* ???? ??? */
    height: 320px; /* ?????? ???? ? ???? */
    display: flex;
    flex-direction: column;
}

.ted-video-card:hover {
    transform: translateY(-4px); /* ???? ??????? */
    box-shadow: var(--ted-shadow-lg);
}

.ted-video-thumbnail {
    position: relative;
    height: 140px; /* ???? ?????? ????? */
    overflow: hidden;
    flex-shrink: 0;
}

.ted-thumbnail-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem; /* ???? ???? ????? */
}

.ted-image-placeholder {
    opacity: 0.7;
}

.ted-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--ted-duration) var(--ted-ease);
}

.ted-video-card:hover .ted-video-overlay {
    opacity: 1;
}

.ted-play-btn {
    width: 50px; /* ???? ???? ???? */
    height: 50px;
    background: var(--ted-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ted-duration) var(--ted-ease);
    transform: scale(0.8);
}

.ted-video-card:hover .ted-play-btn {
    transform: scale(1);
}

.ted-play-btn:hover {
    background: var(--ted-primary-dark);
    transform: scale(1.05); /* ???? ??????? */
}

.ted-video-duration {
    position: absolute;
    bottom: 0.5rem; /* ???? ????? */
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: var(--ted-white);
    padding: 0.2rem 0.4rem; /* ???? padding */
    border-radius: var(--ted-radius-sm);
    font-size: 0.7rem; /* ???? ???? ???? */
    font-weight: 600;
}

.ted-video-content {
    padding: var(--ted-space-md); /* ???? padding */
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ted-video-title {
    font-size: 0.95rem; /* ???? ???? ???? */
    font-weight: 700;
    color: var(--ted-gray-900);
    margin: 0 0 var(--ted-space-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* ??????? ?? 2 ?? */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* ?????? ???? */
    word-break: break-word;
    hyphens: auto;
}

.ted-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ted-space-xs);
    font-size: 0.75rem; /* ???? ???? ???? */
    color: var(--ted-gray-600);
    flex-shrink: 0;
}

.ted-speaker-name {
    font-weight: 600;
    color: var(--ted-primary);
}

.ted-video-description {
    color: var(--ted-gray-700);
    line-height: 1.4;
    margin-bottom: var(--ted-space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2; /* ??????? ?? 2 ?? */
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem; /* ???? ???? ???? */
    flex: 1;
}

.ted-video-tags {
    display: flex;
    gap: 0.375rem;
    margin-bottom: var(--ted-space-sm);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ted-tag {
    background: var(--ted-gray-100);
    color: var(--ted-gray-700);
    padding: 0.2rem 0.5rem; /* ???? padding */
    border-radius: 0.75rem;
    font-size: 0.7rem; /* ???? ???? ???? */
    font-weight: 500;
}

.ted-video-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ted-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    color: var(--ted-gray-600);
    cursor: pointer;
    padding: 0.25rem 0.5rem; /* ???? padding */
    border-radius: var(--ted-radius-sm);
    transition: all var(--ted-duration) var(--ted-ease);
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

.ted-action-btn:hover {
    background: var(--ted-gray-50);
    color: var(--ted-primary);
    transform: translateY(-1px);
}

.ted-action-count {
    font-weight: 600;
    font-size: 0.7rem; /* ???? ???? ???? */
}

/* Categories Grid - FIXED: Centered and proper grid display */
.ted-categories-grid {
    display: grid;
    gap: var(--ted-space-lg);
    width: 100%;
    justify-items: center;
}

/* FIXED: Categories grid columns - Centered */
.ted-categories-grid[data-columns="2"] { 
    grid-template-columns: repeat(2, 1fr); 
}
.ted-categories-grid[data-columns="3"] { 
    grid-template-columns: repeat(3, 1fr); 
}
.ted-categories-grid[data-columns="4"] { 
    grid-template-columns: repeat(4, 1fr); 
}
.ted-categories-grid[data-columns="5"] { 
    grid-template-columns: repeat(5, 1fr); 
}
.ted-categories-grid[data-columns="6"] { 
    grid-template-columns: repeat(6, 1fr); 
}

/* Categories Section - FIXED: Reduced height */
.ted-category-card {
    background: var(--ted-white);
    border-radius: var(--ted-radius-lg);
    padding: var(--ted-space-lg); /* ???? padding */
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--ted-shadow-md);
    transition: all var(--ted-duration) var(--ted-ease);
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 140px; /* ?????? ????? ???? */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ted-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--ted-primary), var(--ted-primary-light));
    transform: scaleX(0);
    transition: transform var(--ted-duration) var(--ted-ease);
}

.ted-category-card:hover {
    transform: translateY(-4px); /* ???? ??????? */
    box-shadow: var(--ted-shadow-lg);
}

.ted-category-card:hover::before {
    transform: scaleX(1);
}

.ted-category-icon {
    font-size: 2rem; /* ???? ???? ????? */
    margin-bottom: var(--ted-space-sm);
}

.ted-category-title {
    font-size: 1rem; /* ???? ???? ???? */
    font-weight: 700;
    color: var(--ted-gray-900);
    margin-bottom: var(--ted-space-xs);
}

.ted-category-count {
    color: var(--ted-gray-600);
    font-size: 0.8rem; /* ???? ???? ???? */
}

.ted-category-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--ted-primary), var(--ted-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ted-white);
    font-weight: 600;
    opacity: 0;
    transition: all var(--ted-duration) var(--ted-ease);
    transform: translateY(100%);
}

.ted-category-card:hover .ted-category-hover {
    opacity: 1;
    transform: translateY(0);
}

/* CTA Section */
.ted-cta {
    background: linear-gradient(135deg, var(--ted-primary), var(--ted-primary-dark));
    color: var(--ted-white);
    text-align: center;
}

.ted-cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.ted-cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--ted-space-md);
}

.ted-cta-description {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: var(--ted-space-xl);
    line-height: 1.6;
}

.ted-cta-actions {
    display: flex;
    gap: var(--ted-space-md);
    justify-content: center;
}

/* Footer Styles */
.ted-footer {
    background: var(--ted-gray-900);
    color: var(--ted-white);
    padding: var(--ted-space-2xl) 0 0;
}

.ted-footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--ted-space-2xl);
    padding-bottom: var(--ted-space-2xl);
}

.ted-footer-brand {
    max-width: 300px;
}

.ted-footer-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
    margin-bottom: var(--ted-space-sm);
}

.ted-logo-primary {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ted-white);
}

.ted-logo-subtitle {
    font-size: 0.75rem;
    color: var(--ted-gray-400);
    font-weight: 500;
}

.ted-footer-description {
    color: var(--ted-gray-400);
    line-height: 1.6;
    margin-bottom: var(--ted-space-md);
}

.ted-social-links {
    display: flex;
    gap: 0.75rem;
}

.ted-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ted-gray-800);
    color: var(--ted-gray-400);
    border-radius: 50%;
    text-decoration: none;
    transition: all var(--ted-duration) var(--ted-ease);
}

.ted-social-link:hover {
    background: var(--ted-primary);
    color: var(--ted-white);
    transform: translateY(-2px);
}

.ted-footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ted-space-xl);
}

.ted-footer-column h4 {
    color: var(--ted-white);
    margin-bottom: var(--ted-space-md);
    font-size: 1.125rem;
    font-weight: 600;
}

.ted-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ted-footer-list li {
    margin-bottom: var(--ted-space-sm);
}

.ted-footer-list a {
    color: var(--ted-gray-400);
    text-decoration: none;
    transition: all var(--ted-duration) var(--ted-ease);
}

.ted-footer-list a:hover {
    color: var(--ted-white);
    transform: translateX(5px);
}

.ted-footer-bottom {
    border-top: 1px solid var(--ted-gray-800);
    padding: var(--ted-space-lg) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ted-gray-400);
    font-size: 0.875rem;
}

.ted-footer-legal {
    display: flex;
    gap: var(--ted-space-lg);
}

.ted-footer-legal a {
    color: var(--ted-gray-400);
    text-decoration: none;
    transition: color var(--ted-duration) var(--ted-ease);
}

.ted-footer-legal a:hover {
    color: var(--ted-white);
}

/* Main Content Spacing */
.ted-main-content {
    margin-top: 80px; /* Account for fixed header */
    position: relative;
    z-index: 1;
}

/* Ensure content is above mobile menu */
.site-content {
    position: relative;
    z-index: 2;
}

/* Popular Videos Ribbon - FIXED: Centered */
.ted-popular-ribbon {
    background: var(--ted-gray-50);
    padding: var(--ted-space-xl) 0; /* ???? padding */
}

.ted-ribbon-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Popular Videos Ribbon - FIXED: Centered grid */
.ted-ribbon-slider {
    display: grid;
    gap: var(--ted-space-lg);
    transition: transform 0.3s var(--ted-ease);
    width: 100%;
    justify-items: center;
    align-items: stretch; /* ??????? ?? ????? ???? ?????? */
}

/* FIXED: Ribbon grid columns - Centered */
.ted-ribbon-slider[data-columns="2"] { 
    grid-template-columns: repeat(2, 1fr); 
}
.ted-ribbon-slider[data-columns="3"] { 
    grid-template-columns: repeat(3, 1fr); 
}
.ted-ribbon-slider[data-columns="4"] { 
    grid-template-columns: repeat(4, 1fr); 
}
.ted-ribbon-slider[data-columns="5"] { 
    grid-template-columns: repeat(5, 1fr); 
}
.ted-ribbon-slider[data-columns="6"] { 
    grid-template-columns: repeat(6, 1fr); 
}

.ted-ribbon-item {
    width: 100%;
    max-width: 260px; /* ???? ??? */
}

/* Popular Videos Section - FIXED: Reduced height */
.ted-popular-video {
    background: var(--ted-white);
    border-radius: var(--ted-radius-md);
    overflow: hidden;
    box-shadow: var(--ted-shadow-sm);
    transition: all var(--ted-duration) var(--ted-ease);
    height: 280px; /* ?????? ???? */
    display: flex;
    flex-direction: column;
}

.ted-popular-video:hover {
    transform: translateY(-3px); /* ???? ??????? */
    box-shadow: var(--ted-shadow-md);
}

.ted-popular-thumbnail {
    position: relative;
    height: 130px; /* ???? ?????? */
    overflow: hidden;
    flex-shrink: 0;
}

.ted-popular-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ted-duration) var(--ted-ease);
}

.ted-popular-video:hover .ted-popular-thumbnail img {
    transform: scale(1.05);
}

.ted-video-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ted-popular-content {
    padding: var(--ted-space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ted-popular-content .ted-video-title {
    font-size: 0.85rem;
    margin-bottom: var(--ted-space-xs);
    min-height: 2.2em;
    word-break: break-word;
    hyphens: auto;
}

.ted-popular-content .ted-video-title a {
    color: var(--ted-gray-900);
    text-decoration: none;
}

.ted-popular-content .ted-video-title a:hover {
    color: var(--ted-primary);
}

.ted-video-category {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem; /* ???? ???? ???? */
    color: var(--ted-gray-600);
    margin-bottom: var(--ted-space-xs);
    flex-shrink: 0;
}

.ted-category-icon {
    font-size: 0.875rem;
}

.ted-video-stats {
    display: flex;
    gap: var(--ted-space-md);
    margin-top: var(--ted-space-sm);
    flex-shrink: 0;
}

.ted-stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem; /* ???? ???? ???? */
    color: var(--ted-gray-600);
}

.ted-ribbon-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ted-white);
    border: 1px solid var(--ted-gray-200);
    border-radius: 50%;
    width: 35px; /* ???? ???? */
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ted-duration) var(--ted-ease);
    z-index: 10;
    opacity: 0;
}

.ted-ribbon-container:hover .ted-ribbon-nav {
    opacity: 1;
}

.ted-ribbon-prev {
    left: -15px; /* ???? ????? */
}

.ted-ribbon-next {
    right: -15px;
}

.ted-ribbon-nav:hover {
    background: var(--ted-primary);
    color: var(--ted-white);
    border-color: var(--ted-primary);
}

.ted-no-videos {
    text-align: center;
    padding: var(--ted-space-2xl);
    color: var(--ted-gray-600);
    grid-column: 1 / -1;
}

/* Loading States */
.ted-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ted-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--ted-gray-300);
    border-top: 2px solid var(--ted-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Video Rows Section Styles - FIXED: Centered */
.ted-video-rows-section {
    padding: var(--ted-space-xl) 0; /* ???? padding */
    background: var(--ted-gray-50);
    width: 100%;
}

.ted-rows-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--ted-space-lg);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Row Header - FIXED: Centered */
.ted-video-row {
    background: var(--ted-white);
    border-radius: var(--ted-radius-xl);
    margin-bottom: var(--ted-space-xl); /* ???? ????? */
    box-shadow: var(--ted-shadow-lg);
    overflow: hidden;
    transition: all var(--ted-duration) var(--ted-ease);
    width: 100%;
}

.ted-video-row:hover {
    box-shadow: var(--ted-shadow-xl);
    transform: translateY(-2px);
}

/* FIXED: ??? ???? ??? */
.ted-row-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--ted-space-xl) var(--ted-space-xl) var(--ted-space-lg);
    border-bottom: 1px solid var(--ted-gray-100);
    background: linear-gradient(135deg, var(--ted-white) 0%, var(--ted-gray-50) 100%);
    width: 100%;
}

.ted-row-title-section {
    margin-bottom: var(--ted-space-md);
}

.ted-row-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ted-gray-900);
    margin: 0 0 var(--ted-space-xs);
    line-height: 1.2;
    text-align: center;
}

.ted-row-subtitle {
    font-size: 1rem;
    color: var(--ted-gray-600);
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

.ted-row-actions {
    display: flex;
    align-items: center;
    gap: var(--ted-space-md);
}

.ted-row-see-all {
    display: inline-flex;
    align-items: center;
    gap: var(--ted-space-xs);
    color: var(--ted-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--ted-duration) var(--ted-ease);
    text-align: center;
    margin: 0 auto;
}

.ted-row-see-all:hover {
    background: var(--ted-gray-50);
    gap: var(--ted-space-sm);
    color: var(--ted-primary-dark);
}

/* Row Content - FIXED: Centered grid */
.ted-row-content {
    padding: var(--ted-space-xl);
    width: 100%;
}

.ted-videos-grid {
    display: grid;
    gap: var(--ted-space-lg);
    transition: all var(--ted-duration) var(--ted-ease);
    width: 100%;
    justify-items: center;
    align-items: stretch; /* ??????? ?? ????? ???? ?????? */
}

/* Video Rows Section - FIXED: Reduced height */
.ted-video-item {
    background: var(--ted-white);
    border-radius: var(--ted-radius-md);
    overflow: hidden;
    box-shadow: var(--ted-shadow-sm);
    transition: all var(--ted-duration) var(--ted-ease);
    position: relative;
    height: 290px; /* ?????? ???? ? ???? */
    display: flex;
    flex-direction: column;
}

.ted-video-item:hover {
    transform: translateY(-3px); /* ???? ??????? */
    box-shadow: var(--ted-shadow-md);
}

.ted-video-thumb {
    position: relative;
    overflow: hidden;
    height: 135px; /* ???? ?????? */
    flex-shrink: 0;
}

.ted-thumb-container {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    width: 100%;
}

.ted-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ted-duration) var(--ted-ease);
}

.ted-video-item:hover .ted-thumb-image {
    transform: scale(1.05);
}

.ted-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ted-primary-light) 0%, var(--ted-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ted-placeholder-icon {
    font-size: 2rem; /* ???? ???? ????? */
    opacity: 0.8;
}

.ted-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--ted-duration) var(--ted-ease);
}

.ted-video-item:hover .ted-video-overlay {
    opacity: 1;
}

.ted-play-button {
    width: 45px; /* ???? ???? ???? */
    height: 45px;
    background: var(--ted-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ted-duration) var(--ted-ease);
    transform: scale(0.8);
}

.ted-video-item:hover .ted-play-button {
    transform: scale(1);
}

.ted-play-button:hover {
    background: var(--ted-primary-dark);
    transform: scale(1.05); /* ???? ??????? */
}

.ted-video-duration {
    position: absolute;
    bottom: 0.5rem; /* ???? ????? */
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: var(--ted-white);
    padding: 0.2rem 0.4rem; /* ???? padding */
    border-radius: var(--ted-radius-sm);
    font-size: 0.7rem; /* ???? ???? ???? */
    font-weight: 600;
}

.ted-featured-badge {
    position: absolute;
    top: 0.5rem; /* ???? ????? */
    right: 0.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: var(--ted-gray-900);
    padding: 0.2rem 0.4rem; /* ???? padding */
    border-radius: var(--ted-radius-sm);
    font-size: 0.65rem; /* ???? ???? ???? */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Video Info */
.ted-video-info {
    padding: var(--ted-space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ted-video-info .ted-video-title {
    font-size: 0.88rem;
    margin-bottom: var(--ted-space-xs);
    min-height: 2.3em;
    word-break: break-word;
    hyphens: auto;
}

.ted-video-info .ted-video-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--ted-duration) var(--ted-ease);
}

.ted-video-info .ted-video-title a:hover {
    color: var(--ted-primary);
}

.ted-video-info .ted-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--ted-space-xs);
    gap: var(--ted-space-sm);
    font-size: 0.73rem;
    flex-shrink: 0;
}

.ted-speaker-info {
    flex: 1;
}

.ted-speaker-name {
    display: block;
    font-weight: 600;
    color: var(--ted-primary);
    font-size: 0.75rem; /* ???? ???? ???? */
    margin-bottom: 0.1rem; /* ???? ????? */
}

.ted-speaker-title {
    display: block;
    font-size: 0.65rem; /* ???? ???? ???? */
    color: var(--ted-gray-600);
}

.ted-video-stats {
    display: flex;
    gap: var(--ted-space-md);
    font-size: 0.7rem; /* ???? ???? ???? */
    color: var(--ted-gray-600);
}

.ted-views-count,
.ted-likes-count {
    display: flex;
    align-items: center;
    gap: 0.2rem; /* ???? ????? */
    white-space: nowrap;
}

.ted-video-category {
    margin-bottom: var(--ted-space-sm);
    flex-shrink: 0;
}

.ted-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem; /* ???? ????? */
    background: var(--ted-gray-100);
    color: var(--ted-gray-700);
    padding: 0.3rem 0.6rem; /* ???? padding */
    border-radius: 1rem;
    font-size: 0.7rem; /* ???? ???? ???? */
    font-weight: 500;
    text-decoration: none;
    transition: all var(--ted-duration) var(--ted-ease);
    border: 1px solid transparent;
}

.ted-category-tag:hover {
    background: var(--ted-primary-light);
    color: var(--ted-white);
    border-color: var(--ted-primary);
}

.ted-video-description {
    color: var(--ted-gray-700);
    font-size: 0.75rem; /* ???? ???? ???? */
    line-height: 1.4;
    margin: 0 0 var(--ted-space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2; /* ??????? ?? 2 ?? */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Video Actions */
.ted-video-actions {
    display: flex;
    gap: 0.5rem; /* ???? ????? */
    border-top: 1px solid var(--ted-gray-100);
    padding-top: var(--ted-space-sm); /* ???? padding */
    margin-top: auto;
    flex-shrink: 0;
}

/* Latest Videos Section - FIXED: Reduced height */
.ted-latest-item {
    background: var(--ted-white);
    border-radius: var(--ted-radius-lg);
    overflow: hidden;
    box-shadow: var(--ted-shadow-md);
    transition: all var(--ted-duration) var(--ted-ease);
    position: relative;
    height: 300px; /* ?????? ???? ? ???? */
    display: flex;
    flex-direction: column;
}

.ted-latest-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ted-shadow-lg);
}

.ted-latest-thumb {
    position: relative;
    overflow: hidden;
    height: 140px; /* ???? ?????? */
    flex-shrink: 0;
}

.ted-latest-info {
    padding: var(--ted-space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ted-latest-info .ted-video-title {
    font-size: 0.9rem;
    margin-bottom: var(--ted-space-xs);
    min-height: 2.4em;
    word-break: break-word;
    hyphens: auto;
}

.ted-latest-info .ted-video-meta {
    font-size: 0.75rem;
    margin-bottom: var(--ted-space-xs);
    flex-shrink: 0;
}

/* Mobile Menu Styles */
.ted-mobile-toggle {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.ted-mobile-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ted-mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--ted-gray-800);
    border-radius: 2px;
    transition: var(--ted-duration) var(--ted-ease);
}

.ted-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    z-index: 9999;
    transition: right 0.4s ease;
}

.ted-mobile-menu.active {
    right: 0;
}

.ted-mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.ted-mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ted-mobile-menu.active .ted-mobile-menu-content {
    transform: translateX(0);
}

.ted-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--ted-gray-200);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.ted-mobile-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ted-gray-600);
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.ted-mobile-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ted-mobile-nav {
    padding: 20px;
}

.ted-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ted-mobile-menu-item {
    margin-bottom: 8px;
}

.ted-mobile-menu-link {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--ted-gray-700);
    font-weight: 600;
    border-radius: var(--ted-radius-md);
    transition: all var(--ted-duration) var(--ted-ease);
    background: #f8f9fa;
}

.ted-mobile-menu-link:hover {
    background: linear-gradient(135deg, var(--ted-primary), var(--ted-primary-dark));
    color: white;
    transform: translateX(-5px);
}

/* Sticky Header */
.ted-header-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive Mobile Menu */
@media (max-width: 768px) {
    .ted-main-nav {
        display: none;
    }
    
    .ted-mobile-toggle {
        display: flex;
    }
    
    .ted-header-actions {
        display: none;
    }
}

/* Ensure all sections have proper spacing and centering */
.ted-section > .ted-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* FIXED: Grid alignment fixes - Centered */
.ted-latest-grid,
.ted-videos-grid,
.ted-categories-grid,
.ted-ribbon-slider {
    justify-items: center;
    align-items: stretch; /* ??????? ?? ????? ???? ?????? */
}

/* Video item alignment */
.ted-video-item {
    width: 100%;
    height: 100%;
}

/* Category card alignment */
.ted-category-card {
    width: 100%;
    height: 100%;
}

/* Popular video alignment */
.ted-popular-video {
    width: 100%;
}

/* Improved hover effects for smaller cards */
.ted-video-card:hover .ted-video-thumbnail img,
.ted-latest-item:hover .ted-thumb-image,
.ted-popular-video:hover .ted-popular-thumbnail img,
.ted-video-item:hover .ted-thumb-image {
    transform: scale(1.05);
}

/* Enhanced mobile experience */
@media (max-width: 480px) {
    .ted-video-card,
    .ted-latest-item,
    .ted-popular-video,
    .ted-video-item {
        min-height: 240px;
        height: auto;
    }
    
    .ted-video-thumbnail,
    .ted-latest-thumb,
    .ted-popular-thumbnail,
    .ted-video-thumb {
        height: 120px;
    }
    
    .ted-category-card {
        height: 100px;
        padding: var(--ted-space-sm);
    }
    
    .ted-category-icon {
        font-size: 1.5rem;
    }
    
    .ted-category-title {
        font-size: 0.9rem;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ted-latest-grid[data-columns="6"],
    .ted-latest-grid[data-columns="5"] { 
        grid-template-columns: repeat(4, 1fr); 
    }
    
    .ted-videos-grid[data-layout="grid"][data-columns="6"],
    .ted-videos-grid[data-layout="grid"][data-columns="5"] { 
        grid-template-columns: repeat(4, 1fr); 
    }
    
    .ted-footer-main {
        grid-template-columns: 1fr 1fr;
        gap: var(--ted-space-xl);
    }
    
    .ted-footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .ted-hero-title {
        font-size: 3rem;
    }
    
    .ted-latest-grid[data-columns="6"],
    .ted-latest-grid[data-columns="5"],
    .ted-latest-grid[data-columns="4"] { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .ted-videos-grid[data-layout="grid"][data-columns="6"],
    .ted-videos-grid[data-layout="grid"][data-columns="5"],
    .ted-videos-grid[data-layout="grid"][data-columns="4"] { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .ted-videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .ted-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .ted-container {
        padding: 0 var(--ted-space-sm);
    }
    
    .ted-header-container {
        flex-direction: column;
        gap: var(--ted-space-md);
        padding: 1rem 0;
    }
    
    .ted-main-nav {
        gap: 1rem;
    }
    
    .ted-hero-title {
        font-size: 2.5rem;
    }
    
    .ted-hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .ted-hero-stats {
        flex-direction: column;
        gap: var(--ted-space-lg);
    }
    
    .ted-section-title {
        font-size: 2rem;
    }
    
    .ted-latest-grid[data-columns="6"],
    .ted-latest-grid[data-columns="5"],
    .ted-latest-grid[data-columns="4"],
    .ted-latest-grid[data-columns="3"] { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .ted-videos-grid[data-layout="grid"][data-columns="6"],
    .ted-videos-grid[data-layout="grid"][data-columns="5"],
    .ted-videos-grid[data-layout="grid"][data-columns="4"],
    .ted-videos-grid[data-layout="grid"][data-columns="3"] { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .ted-videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .ted-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .ted-ribbon-slider {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .ted-cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .ted-footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .ted-footer-links {
        grid-template-columns: 1fr;
    }
    
    .ted-footer-bottom {
        flex-direction: column;
        gap: var(--ted-space-md);
        text-align: center;
    }
    
    .ted-social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ted-hero-title {
        font-size: 2rem;
    }
    
    .ted-section-title {
        font-size: 1.75rem;
    }
    
    .ted-cta-title {
        font-size: 2rem;
    }
    
    .ted-latest-grid[data-columns="6"],
    .ted-latest-grid[data-columns="5"],
    .ted-latest-grid[data-columns="4"],
    .ted-latest-grid[data-columns="3"],
    .ted-latest-grid[data-columns="2"] { 
        grid-template-columns: 1fr; 
    }
    
    .ted-videos-grid[data-layout="grid"][data-columns="6"],
    .ted-videos-grid[data-layout="grid"][data-columns="5"],
    .ted-videos-grid[data-layout="grid"][data-columns="4"],
    .ted-videos-grid[data-layout="grid"][data-columns="3"],
    .ted-videos-grid[data-layout="grid"][data-columns="2"] { 
        grid-template-columns: 1fr; 
    }
    
    .ted-videos-grid,
    .ted-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .ted-ribbon-slider {
        grid-template-columns: 1fr;
    }
    
    .ted-ribbon-nav {
        display: none;
    }
}

/* FIXED: Additional centering styles for all grid sections */
.ted-latest-videos .ted-section-header,
.ted-featured .ted-section-header,
.ted-categories .ted-section-header,
.ted-popular-ribbon .ted-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ted-latest-videos .ted-latest-grid,
.ted-featured .ted-videos-grid,
.ted-categories .ted-categories-grid,
.ted-popular-ribbon .ted-ribbon-slider {
    display: grid;
    justify-items: center;
    align-items: start;
}

/* FIXED: Ensure all grid items are properly centered and aligned */
.ted-latest-item,
.ted-video-card,
.ted-category-card,
.ted-popular-video {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
}