/* Touch-responsive styles for Dollar Illustrated */

/* Touch active states */
.touch-active {
    transform: scale(1.03) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

/* Ensure buttons have sufficient touch target size */
@media (max-width: 768px) {
    .btn,
    .nav-links a,
    .social-icon-hover,
    .card-hover {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        margin: 5px;
    }

    /* Increase spacing between touch elements */
    .nav-links li,
    .footer-links li {
        margin-bottom: 15px;
    }

    /* Ensure form elements are touch-friendly */
    input,
    select,
    textarea,
    button {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px 15px;
    }

    /* Swipe-friendly carousel for blog posts */
    .featured-posts {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        display: flex;
        gap: 15px;
        padding-bottom: 15px;
    }

    .featured-posts .card {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }

    /* Add visual indicator for swipeable content */
    .swipe-indicator {
        display: flex;
        justify-content: center;
        margin-top: 15px;
    }

    .swipe-indicator .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: var(--medium-gray);
        margin: 0 5px;
    }

    .swipe-indicator .dot.active {
        background-color: var(--primary-color);
    }

    /* Improve touch feedback */
    a:active,
    button:active,
    .card:active {
        opacity: 0.7;
    }

    /* Prevent text selection on touch interfaces */
    .no-select {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Tablet-specific touch optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Larger touch targets for tablets */
    .btn,
    .nav-links a {
        padding: 10px 18px;
    }

    /* Tablet-optimized grid layouts */
    .featured-posts {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Ensure sufficient spacing for touch */
    .card {
        margin-bottom: 20px;
    }
}

/* Touch-friendly lightbox for gallery images */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

/* Touch gestures for lightbox */
.lightbox-nav {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.lightbox-nav button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

/* Pinch-to-zoom indicator */
.zoom-hint {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    opacity: 0.7;
}