/* ===================================
   Bento Grid Layout System (Enhanced)
   弁当グリッドレイアウト - 強化版
   =================================== */

/* Main Bento Grid Container */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-md, 1rem);
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive Grid Columns */
@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg, 1.5rem);
        padding: var(--spacing-lg, 1.5rem);
    }
}

/* ===================================
   Bento Card Base Styles
   =================================== */

.bento-card {
    position: relative;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    transition: all var(--transition-base, 200ms ease);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

/* Hover Effects */
.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl, 0 20px 25px rgba(0, 0, 0, 0.15));
}

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

/* ===================================
   Size Variants
   =================================== */

/* Large Tile (2x1) */
.bento-card--large {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .bento-card--large {
        grid-column: span 2;
    }
}

/* Hero Tile (2x2) */
.bento-card--hero {
    grid-column: span 1;
    min-height: 300px;
}

@media (min-width: 768px) {
    .bento-card--hero {
        grid-column: span 2;
        grid-row: span 2;
        min-height: 400px;
    }
}

/* ===================================
   Card Content Structure
   =================================== */

.bento-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.bento-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

.bento-card__content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-lg, 1.5rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 1;
    color: white;
}

.bento-card__icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm, 0.5rem);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.bento-card__title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs, 0.25rem);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bento-card__subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.bento-card__badge {
    position: absolute;
    top: var(--spacing-md, 1rem);
    right: var(--spacing-md, 1rem);
    background: var(--color-primary, #8E050F);
    color: white;
    padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
}

/* ===================================
   Color Variants
   =================================== */

.bento-card--gourmet .bento-card__badge {
    background: var(--color-kurenai, #8E050F);
}

.bento-card--shop .bento-card__badge {
    background: var(--color-ai, #090D4F);
}

.bento-card--hidden .bento-card__badge {
    background: var(--color-kohaku, #F59A36);
}

/* ===================================
   Special Cards
   =================================== */

/* Map Card */
.bento-card--map {
    background: linear-gradient(135deg, #1E1B4B, #090D4F);
}

.bento-card--map .bento-card__content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Search Card */
.bento-card--search {
    background: var(--color-bg-dark, #FAF5F0);
    color: var(--color-text, #333);
}

.bento-card--search .bento-card__content {
    justify-content: center;
    align-items: center;
}

.bento-card--search .bento-card__icon {
    color: var(--color-primary, #8E050F);
    filter: none;
}

.bento-card--search .bento-card__title {
    color: var(--color-text, #333);
    text-shadow: none;
}

/* Featured Card (赤福など) */
.bento-card--featured {
    background: linear-gradient(135deg, #7F1D1D, #8E050F);
}

.bento-card--featured .bento-card__title {
    font-size: 1.8rem;
}

.bento-card--featured .bento-card__badge {
    background: var(--color-kohaku, #F59A36);
}

/* CTA Button */
.bento-card__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs, 0.25rem);
    margin-top: var(--spacing-md, 1rem);
    padding: var(--spacing-sm, 0.5rem) var(--spacing-lg, 1.5rem);
    background: var(--color-primary, #8E050F);
    color: white;
    border: none;
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base, 200ms ease);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
}

.bento-card__cta:hover {
    background: var(--color-primary-dark, #7F1D1D);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
}

/* ===================================
   Accessibility
   =================================== */

.bento-card:focus-visible {
    outline: 3px solid var(--color-primary, #8E050F);
    outline-offset: 2px;
}

/* ===================================
   Mobile Optimizations
   =================================== */

@media (max-width: 767px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md, 1rem);
        padding: var(--spacing-sm, 0.5rem);
    }

    .bento-card {
        min-height: 180px;
    }

    .bento-card--hero {
        min-height: 250px;
    }

    .bento-card__title {
        font-size: 1.3rem;
    }

    .bento-card__content {
        padding: var(--spacing-md, 1rem);
    }
}

/* ===================================
   Legacy Spot Card Compatibility
   =================================== */

/* Existing spots-grid styles */
.spots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.spot-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.spot-card.wide {
    grid-column: span 2;
}

.spot-card.tall {
    grid-row: span 2;
}

@media (max-width: 1200px) {
    .spots-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .spot-card.featured {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .spots-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .spot-card.featured,
    .spot-card.wide,
    .spot-card.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.spot-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

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

.spot-card.featured .spot-image {
    height: 400px;
}

.spot-card.featured h3 {
    font-size: 1.5rem;
}

.spot-card.featured .spot-description {
    font-size: 1rem;
    max-height: none;
    -webkit-line-clamp: 4;
}

/* ===================================
   Ranking & Guide Specific Styles
   =================================== */

/* Ranking Badges */
.bento-card--rank-1 .bento-card__badge {
    background: linear-gradient(135deg, #FFD700, #FDB931);
    color: #8E050F;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.bento-card--rank-2 .bento-card__badge {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    color: #333;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.bento-card--rank-3 .bento-card__badge {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: white;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

/* Feature/Tip Cards (Rainy Day) */
.bento-card--tip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bento-card--tip .bento-card__icon {
    color: #FFD700;
}

.bento-card--tip .bento-card__title {
    color: white;
    text-shadow: none;
}

.bento-card--tip .bento-card__content {
    justify-content: flex-start;
}

.bento-card--tip:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Checklist Card */
.bento-card--checklist {
    background: #FFF9E6;
    border: 2px dashed #FFA500;
    color: #333;
}

.bento-card--checklist .bento-card__content {
    color: #333;
    justify-content: flex-start;
    padding: var(--spacing-lg, 1.5rem);
}

.bento-card--checklist .bento-card__title {
    color: #FF8C00;
    text-shadow: none;
    margin-bottom: 15px;
}

.bento-card--checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.bento-card--checklist li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.bento-card--checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.1rem;
}