/* Portfolio page specific styles */

/* Portfolio Section */
.portfolio-section {
    padding: 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Photography Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1400px;
    width: 100%;
}

.category-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    /* Fix for category card link styling - override base.css */
    color: inherit !important;
    text-decoration: none !important;
    display: block;
}

.category-card * {
    color: inherit;
}

.category-card:visited,
.category-card:link,
.category-card:active {
    color: inherit !important;
    text-decoration: none !important;
}

.category-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.category-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Better image rendering for mobile */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.category-content {
    padding: 30px;
}

.category-content h3 {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #ffffff !important;
}

.category-content h3 a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-content h3 a:hover {
    background: linear-gradient(45deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-card:hover h3 {
    background: linear-gradient(45deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #cccccc;
    margin-bottom: 20px;
    font-weight: 300;
}

.view-gallery {
    font-size: 14px;
    color: #aaaaaa !important;
    letter-spacing: 1px;
    font-weight: 300;
    transition: color 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
}

.view-gallery:hover {
    color: #ffffff !important;
}

.category-card:hover .view-gallery {
    color: #ffffff !important;
}

/* Tablet styles */
@media (max-width: 1199px) and (min-width: 769px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .portfolio-section {
        padding: 80px 30px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 60px 20px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .category-image {
        height: 250px;
        /* Increased for better mobile display */
        min-height: 200px;
    }

    .category-content {
        padding: 20px;
    }

    /* Mobile-specific fixes for category card text color */
    .category-card {
        color: inherit !important;
        text-decoration: none !important;
        -webkit-text-fill-color: initial !important;
    }

    .category-card h3,
    .category-content h3 {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .category-card .view-gallery {
        color: #aaaaaa !important;
        -webkit-text-fill-color: #aaaaaa !important;
    }

    .category-card:hover h3,
    .category-card:hover .category-content h3 {
        background: linear-gradient(45deg, #ffffff, #cccccc) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
    }

    .category-card:hover .view-gallery {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .portfolio-section {
        padding: 40px 15px;
    }

    .category-content {
        padding: 15px;
    }

    .category-content h3 {
        font-size: 20px;
    }

    .category-content p {
        font-size: 14px;
    }

    .category-image {
        height: 200px;
    }

    /* Additional mobile fixes for very small screens */
    .category-card {
        color: inherit !important;
        text-decoration: none !important;
    }

    .category-card h3,
    .category-content h3 {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .category-card .view-gallery {
        color: #aaaaaa !important;
        -webkit-text-fill-color: #aaaaaa !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .category-image {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .category-image img {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    .category-card:active {
        transform: scale(0.98);
    }
}