/**
 * Template: Cases Archive — Layout and Responsive Styles
 * ========================================================
 *
 * Grid layout for the cases archive page:
 * - Compact hero variant (centered, no illustration column)
 * - Responsive card grid for .x-card-case items
 *
 * Depends on:
 *   - custom-tokens.css (design tokens)
 *   - global-classes.css (.x-section-warm, .x-section-soft, .x-container,
 *     .x-card, .x-card-case, .x-btn-primary)
 *   - patterns/hero.css (.x-pattern-hero base styles)
 *
 * Requirements: 5.1, 18.3
 *
 * @package Xenopz
 */

/* =========================================================================
   HERO VARIANT — COMPACT (centered, no image column)
   ========================================================================= */

.x-pattern-hero--compact .x-cases-hero {
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: var(--x-space-lg) 0;
}

.x-pattern-hero--compact .x-cases-hero h1 {
    margin: 0 0 var(--x-space-sm) 0;
}

.x-pattern-hero--compact .x-hero-subline {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================================
   CASES GRID
   ========================================================================= */

/**
 * .x-cases-grid
 * Responsive card grid: 3 columns on desktop, 2 on tablet, 1 on mobile.
 */
.x-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--x-space-lg);
}

/* =========================================================================
   CARD CASE — ARCHIVE VARIANT
   ========================================================================= */

/**
 * Override .x-card-case within the archive grid for consistent card layout.
 */
.x-cases-archive .x-card-case {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow: hidden;
    padding: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.x-cases-archive .x-card-case:hover {
    transform: translateY(-2px);
    box-shadow: var(--x-shadow-hover);
}

/* Image link wrapper */
.x-card-case__image-link {
    display: block;
    overflow: hidden;
    border-radius: var(--x-radius-lg) var(--x-radius-lg) 0 0;
}

.x-card-case__image-link img,
.x-cases-archive .x-card-case img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--x-radius-lg) var(--x-radius-lg) 0 0;
    transition: transform 0.3s ease;
}

.x-cases-archive .x-card-case:hover img {
    transform: scale(1.03);
}

/* Content area inside each card */
.x-card-case__content {
    display: flex;
    flex-direction: column;
    gap: var(--x-space-xs);
    padding: var(--x-space-md);
    flex: 1;
}

/* Title link styling */
.x-card-case__title a {
    color: var(--x-teal-900);
    text-decoration: none;
    transition: color 0.2s ease;
}

.x-card-case__title a:hover,
.x-card-case__title a:focus-visible {
    color: var(--x-orange-500);
}

/* Subtitle */
.x-card-case__subtitle {
    font-family: var(--x-font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--x-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Challenge text */
.x-card-case__text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--x-ink);
    margin: 0;
    flex: 1;
}

/* CTA button at card bottom */
.x-card-case__cta {
    align-self: flex-start;
    margin-top: auto;
    padding-top: var(--x-space-sm);
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.x-cases-empty {
    text-align: center;
    padding: var(--x-space-xl) 0;
    color: var(--x-muted);
    font-size: 1.0625rem;
}

/* =========================================================================
   RESPONSIVE: TABLET (768px - 991px)
   ========================================================================= */

@media (max-width: 991px) {
    .x-cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--x-space-md);
    }
}

/* =========================================================================
   RESPONSIVE: MOBILE (< 768px)
   ========================================================================= */

@media (max-width: 767px) {
    .x-cases-grid {
        grid-template-columns: 1fr;
        gap: var(--x-space-md);
    }

    .x-pattern-hero--compact .x-cases-hero {
        padding: var(--x-space-md) 0;
        text-align: left;
    }

    .x-pattern-hero--compact .x-hero-subline {
        margin-left: 0;
    }
}
