/**
 * KPC Restaurants - Mobile First Styles
 * Optimized for touch devices and mobile viewing
 */

/* Import Open Sans Font */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

/* ===========================
   RESTAURANT GRID - MOBILE FIRST
   =========================== */

.kpc-restaurant-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 10px;
    margin: 0 auto;
    max-width: 1200px;
    font-family: 'Open Sans', sans-serif;
}

.kpc-restaurant-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.kpc-restaurant-card:active {
    transform: scale(0.98);
}

.kpc-restaurant-link {
    display: block;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.kpc-restaurant-image {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    min-height: 200px;
    transition: transform 0.3s ease;
}

.kpc-restaurant-image--empty {
    background: linear-gradient(135deg, #f6f8fb 0%, #eaeff5 100%);
}

.kpc-image-placeholder-text {
    font-size: 12px;
    color: #98a6b9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.kpc-restaurant-card:hover .kpc-restaurant-image {
    transform: scale(1.02);
}

.kpc-restaurant-content {
    padding: 16px;
}

.kpc-restaurant-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333 !important;
    line-height: 1.3;
    display: block !important;
    visibility: visible !important;
}

.kpc-restaurant-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.kpc-restaurant-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7290A8;
    margin-top: 8px;
}

.kpc-restaurant-location .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Tablet - 2 columns */
@media (min-width: 600px) {
    .kpc-restaurant-grid.kpc-columns-2,
    .kpc-restaurant-grid.kpc-columns-3,
    .kpc-restaurant-grid.kpc-columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 20px;
    }
    
    .kpc-restaurant-image {
        min-height: 220px;
    }
    
    .kpc-restaurant-title {
        font-size: 22px;
    }
}

/* Desktop - Respect column settings */
@media (min-width: 1024px) {
    .kpc-restaurant-grid.kpc-columns-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .kpc-restaurant-grid.kpc-columns-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .kpc-restaurant-image {
        min-height: 240px;
    }
}

/* ===========================
   SINGLE RESTAURANT - MOBILE FIRST
   =========================== */

.kpc-single-restaurant-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
}

.kpc-restaurant-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

.kpc-single-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

.kpc-single-image {
    width: 100vw;
    max-width: 100vw;
    height: 250px;
    overflow: hidden;
    margin-bottom: 20px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kpc-single-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kpc-single-header {
    padding: 0 16px;
    margin-bottom: 20px;
}

.kpc-single-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.2;
}

.kpc-single-meta {
    margin-top: 16px;
}

.kpc-single-location,
.kpc-single-phone,
.kpc-single-website {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #555;
    margin-top: 8px;
}

.kpc-single-phone a,
.kpc-single-website a {
    color: #7290A8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.kpc-single-phone a:hover,
.kpc-single-website a:hover {
    color: #5a7088;
    text-decoration: underline;
}

.kpc-single-phone a:active,
.kpc-single-website a:active {
    opacity: 0.7;
}

.kpc-single-location .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.kpc-single-description {
    padding: 0 16px;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.7;
    color: #444;
}

.kpc-single-description p {
    margin-bottom: 16px;
}

.kpc-single-hours,
.kpc-single-map {
    padding: 0 16px;
    margin-bottom: 30px;
}

.kpc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 2px solid #7290A8;
}

.kpc-section-title .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    color: #7290A8;
}

.kpc-icon {
    font-size: 20px;
    margin-right: 8px;
}

.kpc-single-back {
    margin-top: 40px;
    margin-bottom: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.kpc-back-button {
    display: inline-block;
    padding: 12px 24px;
    background: #7290A8;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.kpc-back-button:hover {
    background: #5a7088;
    color: #ffffff;
}

.kpc-back-button:active {
    transform: scale(0.98);
}

.kpc-hours-content {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.kpc-map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kpc-map-container iframe {
    width: 100%;
    height: 300px;
    border: 0;
    display: block;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .kpc-single-image {
        height: 500px;
        margin-bottom: 30px;
    }
    
    .kpc-single-header {
        padding: 0 24px;
    }
    
    .kpc-single-title {
        font-size: 36px;
    }
    
    .kpc-single-description,
    .kpc-single-hours,
    .kpc-single-map {
        padding: 0 24px;
    }
    
    .kpc-map-container iframe {
        height: 450px;
    }
}

/* ===========================
   TOUCH OPTIMIZATION
   =========================== */

@media (hover: none) and (pointer: coarse) {
    .kpc-restaurant-card,
    .kpc-restaurant-link {
        -webkit-tap-highlight-color: rgba(114, 144, 168, 0.1);
    }
    
    .kpc-restaurant-card {
        min-height: 44px;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

.kpc-restaurant-link:focus {
    outline: 2px solid #7290A8;
    outline-offset: 2px;
}

.kpc-restaurant-card:focus-within {
    box-shadow: 0 4px 16px rgba(114, 144, 168, 0.3);
}

/* ===========================
   LOADING STATES
   =========================== */

.kpc-restaurant-image:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .kpc-restaurant-grid {
        display: block;
    }
    
    .kpc-restaurant-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .kpc-map-container {
        display: none;
    }
}
