/**
 * Hospitable PMS Properties Grid Styles
 * Styles for [hospitable_properties] shortcode
 * Used on archive/listing pages
 */

/* ========================================
   Properties Wrapper
======================================== */
.hospitable-properties-wrapper {
    margin: 40px 0;
}

/* ========================================
   Properties Grid Container
======================================== */
.hospitable-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 0;
    list-style: none;
}

/* ========================================
   Property Card
======================================== */
.hospitable-property-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hospitable-property-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Card Link */
.hospitable-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hospitable-card-link:hover,
.hospitable-card-link:focus {
    outline: none;
}

/* ========================================
   Card Image
======================================== */
.hospitable-card-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.hospitable-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hospitable-property-card:hover .hospitable-card-image img {
    transform: scale(1.05);
}

/* ========================================
   Card Content
======================================== */
.hospitable-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Card Title */
.hospitable-card-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    transition: color 0.2s ease;
}

.hospitable-property-card:hover .hospitable-card-title {
    color: #0066cc;
}

/* ========================================
   Card Info Section
======================================== */
.hospitable-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.hospitable-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    white-space: nowrap;
}

/* Info Icon */
.hospitable-info-icon {
    display: inline-flex;
    align-items: center;
    color: #0066cc;
    flex-shrink: 0;
}

.hospitable-info-icon svg {
    width: 16px;
    height: 16px;
}

/* Info Label */
.hospitable-info-label {
    font-weight: 500;
    color: #333;
}

/* Info Value */
.hospitable-info-value {
    font-weight: 600;
    color: #1a1a1a;
}

/* ========================================
   View More Button
======================================== */
.hospitable-view-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.hospitable-view-more-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background-color: #0066cc;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.hospitable-view-more-button:hover,
.hospitable-view-more-button:focus {
    background-color: #0052a3;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
    transform: translateY(-2px);
}

.hospitable-view-more-button:active {
    transform: translateY(0);
}

.hospitable-view-more-button svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.hospitable-view-more-button:hover svg {
    transform: translateX(4px);
}

/* ========================================
   No Properties Message
======================================== */
.hospitable-no-properties {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin: 40px 0;
}

.hospitable-no-properties p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet Landscape (1024px and below) */
@media screen and (max-width: 1024px) {
    .hospitable-properties-wrapper {
        margin: 30px 0;
    }

    .hospitable-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }

    .hospitable-card-image {
        height: 220px;
    }

    .hospitable-card-title {
        font-size: 18px;
    }

    .hospitable-view-more-wrapper {
        margin-top: 30px;
    }
}

/* Tablet Portrait (768px and below) */
@media screen and (max-width: 768px) {
    .hospitable-properties-wrapper {
        margin: 24px 0;
    }

    .hospitable-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .hospitable-card-image {
        height: 200px;
    }

    .hospitable-card-content {
        padding: 16px;
    }

    .hospitable-card-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .hospitable-info-item {
        font-size: 13px;
        padding: 5px 10px;
        gap: 5px;
    }

    .hospitable-view-more-wrapper {
        margin-top: 24px;
    }

    .hospitable-view-more-button {
        font-size: 15px;
        padding: 12px 28px;
    }
}

/* Mobile (480px and below) */
@media screen and (max-width: 480px) {
    .hospitable-properties-wrapper {
        margin: 20px 0;
    }

    .hospitable-properties-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hospitable-card-image {
        height: 180px;
    }

    .hospitable-card-content {
        padding: 14px;
    }

    .hospitable-card-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .hospitable-card-info {
        gap: 8px;
    }

    .hospitable-info-item {
        font-size: 12px;
        padding: 4px 8px;
    }

    .hospitable-info-icon svg {
        width: 14px;
        height: 14px;
    }

    .hospitable-view-more-wrapper {
        margin-top: 20px;
    }

    .hospitable-view-more-button {
        font-size: 14px;
        padding: 12px 24px;
        width: 100%;
        justify-content: center;
    }
}

/* Very Small Mobile (360px and below) */
@media screen and (max-width: 360px) {
    .hospitable-card-info {
        flex-direction: column;
        align-items: stretch;
    }

    .hospitable-info-item {
        justify-content: flex-start;
    }
}

/* ========================================
   RTL Support
======================================== */
.rtl .hospitable-info-item {
    flex-direction: row-reverse;
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .hospitable-property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .hospitable-property-card:hover {
        transform: none;
    }
}

/* ========================================
   Accessibility Improvements
======================================== */
.hospitable-card-link:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    border-radius: 12px;
}

.hospitable-view-more-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .hospitable-property-card,
    .hospitable-card-image img,
    .hospitable-card-title,
    .hospitable-view-more-button,
    .hospitable-view-more-button svg {
        transition: none;
    }

    .hospitable-property-card:hover {
        transform: none;
    }

    .hospitable-property-card:hover .hospitable-card-image img {
        transform: none;
    }

    .hospitable-view-more-button:hover {
        transform: none;
    }

    .hospitable-view-more-button:hover svg {
        transform: none;
    }
}
