/**
 * Puppy Listings Shortcode Styles
 * 
 * Responsive grid layout for displaying puppy cards
 */

/* Container */
.puppy-listings-container {
    width: 100%;
    margin: 0 auto;
}

/* Grid Layout */
.puppy-listings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(8, 1fr); /* Desktop: 8 columns */
    margin: 20px 0;
}

/* Tablet Layout - 6 columns */
@media (max-width: 1024px) {
    .puppy-listings-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 18px;
    }
}

/* Mobile Layout - 3 columns */
@media (max-width: 768px) {
    .puppy-listings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Very small screens - maintain 3 columns with larger gaps for touch targets */
@media (max-width: 480px) {
    .puppy-listings-grid {
        gap: 16px; /* Increased for better touch target spacing */
        grid-template-columns: repeat(2, 1fr); /* Reduced to 2 columns for larger touch targets */
    }
}

/* Puppy Card */
.puppy-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .puppy-card {
        transition: none;
    }
    
    .puppy-card:hover {
        transform: none;
    }
}

.puppy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Card Link */
.puppy-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.puppy-card-link:hover,
.puppy-card-link:focus {
    text-decoration: none;
    color: inherit;
}

/* Card Image */
.puppy-card-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* 1:1 aspect ratio */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Ensure image accessibility */
.puppy-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
}

/* Card Content */
.puppy-card-content {
    padding: 15px;
    text-align: center;
}

/* Puppy Name */
.puppy-card-name {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Mobile adjustments for text */
@media (max-width: 768px) {
    .puppy-card-content {
        padding: 12px;
    }
    
    .puppy-card-name {
        font-size: 12px; /* Increased for WCAG compliance */
    }
}

@media (max-width: 480px) {
    .puppy-card-content {
        padding: 10px;
    }
    
    .puppy-card-name {
        font-size: 12px; /* Increased for WCAG compliance */
    }
}

/* Error and Empty States */
.puppy-listings-error,
.puppy-listings-empty {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    color: #495057; /* Improved contrast for WCAG compliance */
    font-style: italic;
    margin: 20px 0;
}

.puppy-listings-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Focus styles for accessibility */
.puppy-card-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .puppy-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .puppy-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .puppy-card-name {
        font-size: 14px !important; /* Ensure readable text size in print */
        color: #000 !important; /* Ensure high contrast in print */
    }
}
