/* =========================================
   1. FONTS & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Arapey:ital@0;1&display=swap');

:root {
    --clw-font-title: 'Arapey', serif;
    --clw-color-dark: #000000;
    --clw-color-light: #ffffff;
    /* Brand Colors */
    --clw-color-red: #ff3a2d;
    --clw-color-yellow: #ffcc00;
    --clw-color-teal: #1cd7b2;
    --clw-color-purple: #b309f1;
    --clw-color-grey: #6c757d; /* Hover Color */
    --clw-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =========================================
   2. THE GRID
   ========================================= */
.clw-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    /* Default columns are set inline by PHP (Desktop) */
}

/* =========================================
   3. THE CARD
   ========================================= */
.clw-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--clw-color-dark);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 1; 
}

/* The Button Wrapper */
.clw-card__btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
}

/* Image Container */
.clw-card__media {
    width: 100%;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3; 
}

.clw-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--clw-ease);
    display: block;
}

/* Scrim (Gradient Overlay) */
.clw-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
    z-index: 2;
    transition: background 0.3s;
}

/* Card Title */
.clw-card__title {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    margin: 0;
    color: var(--clw-color-light);
    font-family: var(--clw-font-title);
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 400;
    z-index: 3;
    transition: transform 0.4s var(--clw-ease);
    transform: translateY(10px);
}

/* Actions Overlay */
.clw-card__overlay {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 4;
    padding: 0 24px;
    pointer-events: none;
}

.clw-card__actions {
    display: flex;
    gap: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s var(--clw-ease);
}

/* =========================================
   4. DESKTOP HOVER EFFECTS
   ========================================= */
@media (min-width: 1025px) {
    .clw-card:hover .clw-card__media img,
    .clw-card__btn:focus .clw-card__media img {
        transform: scale(1.1);
    }
    .clw-card:hover .clw-card__title,
    .clw-card__btn:focus .clw-card__title {
        transform: translateY(-50px);
    }
    .clw-card:hover .clw-card__actions,
    .clw-card__btn:focus .clw-card__actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* =========================================
   5. ACTION BUTTONS (Icons)
   ========================================= */
.clw-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    border: none;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Default Colors */
.clw-action--map { background: var(--clw-color-red); }
.clw-action--call { background: var(--clw-color-yellow); }
.clw-action--sms { background: var(--clw-color-teal); }

/* Hover State: Grey */
.clw-action:hover {
    transform: translateY(-3px);
    background: var(--clw-color-grey);
    color: #fff;
}
.clw-action.clw-action--doordash{ background:  #fff;}
.clw-action.clw-action--doordash:hover { background: var(--clw-color-dark); } /* DoorDash red-ish */
.clw-action .clw-icon--doordash {
  width: 22px;
  height: 22px;
  display: block;
  background-image: url('../images/doordash.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}



/* =========================================
   6. LIGHTBOX / MODAL
   ========================================= */
.clw-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.clw-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.clw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.clw-modal__panel {
    position: relative;
    background: #ffffff !important;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.clw-modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    padding: 10px 0 15px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    z-index: 20;
    transition: background 0.2s;
}
.clw-modal__close:hover { background: #ff3a2d; color: white; }

.clw-modal__header {
    padding: 30px 40px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.clw-modal__title {
    font-family: var(--clw-font-title);
    font-size: 2.8rem;
    margin: 0;
    color: var(--clw-color-dark);
    line-height: 1;
}

.clw-modal__subtitle {
    margin-top: 8px;
    color: #666;
    font-size: 1.1rem;
    font-family: sans-serif;
}

.clw-modal__header-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}
.clw-btn {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: var(--clw-color-red);
    border: 4px solid var(--clw-color-red);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.2s;
}
.clw-btn:hover { background: var(--clw-color-red); color: #fff; }

.clw-modal__body {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: #fff;
}

.clw-section__title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    color: var(--clw-color-red);
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.clw-hours__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #e0e0e0;
    font-size: 0.95rem;
    color: #444;
}
.clw-hours__day { font-weight: 600; color: #000; }

.clw-map {
    width: 100%;
    height: 100%;
    min-height: 250px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}
.clw-map iframe { width: 100%; height: 100%; border: 0; display: block; }

.clw-section:last-child {
    grid-column: 1 / -1;
    margin-top: 20px;
}

/* --- UPDATED GALLERY STYLE (2 COLUMNS) --- */
.clw-gallery {
    display: grid;
    /* CHANGE HERE: Set to 2 columns instead of 4 */
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
}

.clw-gallery__item {
    aspect-ratio: 1/1; /* Keeps them perfect squares */
    border-radius: 8px;
    overflow: hidden;
    display: block;
    background: #eee;
    cursor: default; /* Ensures no "hand" pointer shows on hover */
}

.clw-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Optional: Slight zoom on hover for effect */
.clw-gallery__item:hover img {
    transform: scale(1.05);
}

/* =========================================
   7. MOBILE & TABLET OPTIMIZATIONS
   ========================================= */

/* TABLET GRID: 2 Columns */
@media (min-width: 768px) and (max-width: 1024px) {
    .clw-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* MOBILE GRID: 1 Column */
@media (max-width: 767px) {
    .clw-grid {
        grid-template-columns: 1fr !important;
    }
    /* Stack modal body vertically */
    .clw-modal__body {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
    }
    /* Mobile Gallery: 2 Columns (kept consistent with new design) */
    .clw-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .clw-modal__title { font-size: 2rem; }
}

/* ALWAYS VISIBLE ICONS (Touch Devices) */
@media (max-width: 1024px) {
    /* Push title up permanently */
    .clw-card__title {
        transform: translateY(-60px) !important;
    }
    /* Show icons permanently */
    .clw-card__actions {
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    /* Larger touch targets */
    .clw-action {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    /* Darker overlay for readability */
    .clw-card__media::after {
        background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.9) 100%);
    }
}