/* Editorial justified gallery — shared module (.ej-*)
 *
 * The single source for the homepage-derived justified list pattern that
 * was previously copy-pasted per app with per-page prefixes
 * (tour-justified-*, spot-justified-*, instructor-justified-*, ...).
 * Pages compose these classes and keep only genuinely page-specific rules
 * (extra badge variants, price rows, portrait target heights) in their own
 * CSS, namespaced by their page prefix.
 *
 * Layout engine: static/js/editorial-justified.js (EditorialJustified.init).
 * Recipe: .claude/skills/editorial-list-page/SKILL.md — flat colors only,
 * NO gradients, caption reveal via max-height (canonical mechanic).
 */

/* Canvas wrapper — clientWidth of the inner grid equals the content area */
.ej-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 0.5rem;
}
@media (min-width: 640px) {
    .ej-wrap { padding: 0 1rem; }
}

.ej-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ej-item {
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ej-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.ej-item:hover .ej-img { transform: scale(1.04); }

/* Always-visible bottom caption strip — flat solid color, no gradients */
.ej-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.625rem 0.875rem;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    transition: background 0.25s ease, padding 0.25s ease;
    pointer-events: none;
}
.ej-item:hover .ej-caption {
    background: rgba(0, 0, 0, 0.72);
    padding-bottom: 0.75rem;
}

.ej-caption-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.ej-caption-row--primary { justify-content: space-between; }

.ej-name {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.ej-price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Secondary row — hover-revealed via max-height (never opacity/transform only) */
.ej-caption-row--secondary {
    justify-content: space-between;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ej-item:hover .ej-caption-row--secondary {
    max-height: 1.5rem;
    opacity: 1;
    margin-top: 0.25rem;
}
/* Two-line meta variant (season chips etc.) */
.ej-item:hover .ej-caption-row--secondary.ej-caption-row--tall {
    max-height: 2.5rem;
}

.ej-meta { color: rgba(255, 255, 255, 0.7); }
.ej-meta--strong { font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.ej-meta--accent { color: var(--aerial-blue-light, #E4B068); }

/* Corner badges (always visible) */
.ej-badge {
    position: absolute;
    z-index: 2;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.5rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ej-badge--tl { top: 0.625rem; left: 0.625rem; }
.ej-badge--tr { top: 0.625rem; right: 0.625rem; }
.ej-badge--bl { bottom: 0.625rem; left: 0.625rem; }
.ej-badge--br { bottom: 0.625rem; right: 0.625rem; }
/* Semantic palette (see skill: Featured/Active/Processing/Warning/Blocked) */
.ej-badge--featured { background: var(--aerial-blue, #D4922A); }
.ej-badge--ok { background: #16a34a; }
.ej-badge--processing { background: #7c3aed; }
.ej-badge--warn { background: #ea580c; }
.ej-badge--blocked { background: #dc2626; }
.ej-badge--light {
    background: rgba(255, 255, 255, 0.92);
    color: #374151;
    font-weight: 600;
}

/* Mobile — items full-width with natural aspect; secondary row always shown */
@media (max-width: 767px) {
    .ej-item { width: 100% !important; height: auto !important; }
    .ej-img { height: auto; }
    .ej-caption-row--secondary {
        max-height: 1.5rem;
        opacity: 1;
        margin-top: 0.25rem;
    }
    .ej-caption-row--secondary.ej-caption-row--tall { max-height: 2.5rem; }
}

/* Empty state */
.ej-empty {
    width: 100%;
    max-width: 540px;
    margin: 4rem auto;
    text-align: center;
}
.ej-empty-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}
.ej-empty-text {
    color: #4b5563;
    margin-bottom: 1rem;
}
.ej-empty-link {
    color: var(--aerial-blue, #D4922A);
    font-weight: 600;
    text-decoration: none;
}
.ej-empty-link:hover { text-decoration: underline; }
