/* ===== Projects Page Styles ===== */ /* Main container for projects */ .projects-container { max-width: var(--container-width); margin: 0 auto; padding: var(--sp-6) var(--sp-4); } /* Center alignment for headings */ .center { text-align: center; margin-bottom: var(--sp-6); font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; color: var(--text); position: relative; padding-bottom: var(--sp-4); } .center::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 3px; background: linear-gradient(var(--gradient-direction), var(--primary), var(--secondary)); border-radius: 3px; } /* "Slide for more" instruction */ h2:not(.center) { text-align: center; font-size: 1rem; font-weight: 500; color: var(--text-secondary); margin: var(--sp-6) 0 var(--sp-2); animation: pulse-opacity 2s infinite alternate; } @keyframes pulse-opacity { from { opacity: 0.6; } to { opacity: 1; } } /* Project section container */ .project-section { margin-bottom: var(--sp-12); position: relative; } /* Carousel styling */ .carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; gap: var(--sp-6); padding: var(--sp-2) var(--sp-2) var(--sp-6); margin: 0 -1rem; } .carousel::-webkit-scrollbar { height: 8px; } .carousel::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 4px; } .carousel::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; } /* Project card styling */ .project-card { flex: 0 0 300px; scroll-snap-align: start; background: var(--surface); border-radius: var(--border-radius); box-shadow: var(--shadow); overflow: hidden; transition: all var(--transition-normal); border: 1px solid var(--border); display: flex; flex-direction: column; height: 420px; position: relative; } .project-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); } .project-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(var(--gradient-direction), var(--primary), var(--secondary)); transform: scaleX(0); transform-origin: var(--transform-origin); transition: transform var(--transition-normal); } .project-card:hover::before { transform: scaleX(1); } /* Project banner image */ .project-banner { width: 100%; height: 180px; object-fit: cover; transition: transform var(--transition-normal); } .project-card:hover .project-banner { transform: scale(1.05); } /* Project content area */ .project-content { padding: var(--sp-4); flex: 1; display: flex; flex-direction: column; } .project-title { font-size: 1.3rem; font-weight: 600; margin-bottom: var(--sp-3); color: var(--text); font-family: var(--font-display); } .project-description { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: var(--sp-4); flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; } /* Call to action button */ .cta-button { display: inline-flex; align-items: center; justify-content: center; padding: var(--sp-2) var(--sp-4); background: linear-gradient(var(--gradient-secondary), var(--primary), var(--secondary)); color: white; text-decoration: none; border-radius: var(--border-radius); font-weight: 500; font-size: 0.9rem; transition: all var(--transition-normal); box-shadow: var(--shadow-sm); margin-top: auto; border: none; cursor: pointer; position: relative; overflow: hidden; } .cta-button::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%); transform: translate(-50%, -50%); transition: width 0.6s ease, height 0.6s ease; border-radius: 50%; z-index: 1; } .cta-button:hover { transform: translateY(-3px); box-shadow: var(--shadow); } .cta-button:hover::before { width: 250%; height: 250%; } .cta-button span { position: relative; z-index: 2; } /* ===== RTL Support ===== */ [dir="rtl"] .carousel { direction: rtl; } [dir="rtl"] .project-card::before { transform-origin: right; } [dir="rtl"] .project-content { text-align: right; } /* ===== Dark Mode ===== */ @media (prefers-color-scheme: dark) { .carousel::-webkit-scrollbar-track { background: var(--surface-2); } .carousel::-webkit-scrollbar-thumb { background: var(--accent); } } /* ===== Responsive Styles ===== */ @media (max-width: 768px) { .carousel { gap: var(--sp-4); } .project-card { flex: 0 0 260px; height: 400px; } .center { font-size: 1.75rem; } } @media (max-width: 576px) { .projects-container { padding: var(--sp-4) var(--sp-3); } .project-card { flex: 0 0 220px; height: 380px; } .project-banner { height: 150px; } .center { font-size: 1.5rem; } .project-title { font-size: 1.1rem; } .project-description { font-size: 0.85rem; -webkit-line-clamp: 3; } } /* ===== Print Styles ===== */ @media print { .carousel { overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-4); } .project-card { break-inside: avoid; page-break-inside: avoid; height: auto; } .project-banner { max-height: 100px; } h2:not(.center) { display: none; } } /* ===== Supports Queries for Better Compatibility ===== */ @supports (scrollbar-color: var(--primary) var(--surface-2)) { .carousel { scrollbar-color: var(--primary) var(--surface-2); scrollbar-width: thin; } @media (prefers-color-scheme: dark) { .carousel { scrollbar-color: var(--accent) var(--surface-2); } } } /* Improved animation performance */ @media (prefers-reduced-motion: reduce) { .cta-button, .project-card, .project-banner, .project-card::before { transition: none; } h2:not(.center) { animation: none; opacity: 0.8; } }
