/* Projects Carousel Styles */
.projects-carousel {
    display: flex;
    gap: 1.25rem;
    padding-left: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory; /* Added: Snap to cards */
}

.projects-carousel::-webkit-scrollbar {
    display: none;
}

/* Responsive padding for large screens */
@media (min-width: 1536px) {
    .projects-carousel {
        padding-left: max(8rem, calc(50vw - 700px));
        padding-right: max(0rem, calc(50vw - 700px));
    }
}

/* Project Card */
.project-card {
    flex: 0 0 auto;
    width: 320px;
    scroll-snap-align: start; /* Added: Snap alignment */
}

@media (min-width: 1024px) {
    .project-card {
        width: 360px;
    }
}

.project-card a {
    display: block;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    outline: none; /* Added: Remove default outline */
}

.project-card a:focus-visible {
    outline: 2px solid #000; /* Added: Accessible focus state */
    outline-offset: 2px;
}

.project-card-inner {
    position: relative;
    height: 27rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #f3f4f6; /* Added: Loading state background */
}

.project-card-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.project-card a:hover .project-card-image,
.project-card a:focus-visible .project-card-image { /* Added: Focus state */
    transform: scale(1.05);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8));
    mix-blend-mode: multiply;
    transition: opacity 0.3s ease; /* Added: Smooth transition */
}

.project-card a:hover .project-card-overlay,
.project-card a:focus-visible .project-card-overlay { /* Added: Darken on interaction */
    opacity: 0.9;
}

.project-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
}

@media (min-width: 768px) {
    .project-card-content {
        padding: 2rem;
    }
}

.project-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-top: 1rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .project-card-title {
        margin-bottom: 0.75rem;
        padding-top: 1rem;
    }
}

.project-card-description {
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    opacity: 0.95; /* Added: Slight transparency for better readability */
}

@media (min-width: 768px) {
    .project-card-description {
        margin-bottom: 3rem;
    }
}

@media (min-width: 1024px) {
    .project-card-description {
        margin-bottom: 2.25rem;
    }
}

.project-read-more {
    display: inline-flex; /* Changed: Better alignment */
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500; /* Added: Slightly bolder */
}

.project-read-more::after { /* Added: Arrow using pseudo-element */
    content: '→';
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.project-card a:hover .project-read-more::after,
.project-card a:focus-visible .project-read-more::after {
    transform: translateX(0.25rem);
}

/* Project Dots */
.project-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    border: none;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease; /* Changed: Transition all properties */
    padding: 0;
}

.project-dot:focus-visible { /* Added: Accessible focus state */
    outline: 2px solid #000;
    outline-offset: 2px;
}

.project-dot.active {
    background-color: #000;
    width: 1.5rem; /* Added: Make active dot wider */
}

.project-dot:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.4);
    transform: scale(1.2); /* Added: Slight scale on hover */
}

.project-dot.active:hover {
    background-color: #000;
}

/* Loading state for images */
.project-card-image:not([src]) {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}