/**
 * HC Child Pages Block Styles
 *
 * Displays child pages in a grid with featured images as card backgrounds.
 */

/* ==========================================================================
   Container
   ========================================================================== */

.hc-child-pages {
    width: 100%;
}

.hc-child-pages-no-selection,
.hc-child-pages-no-children {
    text-align: center;
    padding: 2rem;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
}

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

.hc-child-page-card {
    position: relative;
    height: var(--card-height, 350px);
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hc-child-page-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--text-color, #ffffff);
}

.hc-child-page-link:hover,
.hc-child-page-link:focus {
    color: var(--text-color, #ffffff);
    text-decoration: none;
}

/* ==========================================================================
   Card Image
   ========================================================================== */

.hc-child-page-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s ease;
}

.hc-child-page-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==========================================================================
   Card Overlay
   ========================================================================== */

.hc-child-page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color, rgba(31, 41, 55, 0.5));
    transition: background-color 0.3s ease;
}

.hc-child-page-card:hover .hc-child-page-overlay {
    background-color: var(--overlay-hover-color, rgba(31, 41, 55, 0.7));
}

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

.hc-child-page-content {
    position: absolute;
    left: 0;
    right: 0;
    padding: 1.5rem;
    text-align: var(--text-align, left);
    z-index: 1;
}

/* Text position variants */
[data-text-position="top"] .hc-child-page-content {
    top: 0;
}

[data-text-position="center"] .hc-child-page-content {
    top: 50%;
    transform: translateY(-50%);
}

[data-text-position="bottom"] .hc-child-page-content {
    bottom: 0;
}

/* ==========================================================================
   Card Title
   ========================================================================== */

.hc-child-page-title {
    margin: 0 0 0.5rem 0;
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-weight: var(--font-heading-weight, 600);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--text-color, #ffffff);
}

/* ==========================================================================
   Card Button
   ========================================================================== */

.hc-child-page-button-wrapper {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.hc-child-page-card:hover .hc-child-page-button-wrapper {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

.hc-child-page-button-wrapper .btn {
    margin-top: 0.75rem;
}

/* ==========================================================================
   Shadow
   ========================================================================== */

.hc-child-page-card.has-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hc-child-page-card.has-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */

/* Lift effect */
.hc-child-page-card.hover-lift:hover {
    transform: translateY(-8px);
}

/* Zoom effect */
.hc-child-page-card.hover-zoom:hover .hc-child-page-image {
    transform: scale(1.1);
}

/* Glow effect */
.hc-child-page-card.hover-glow:hover {
    box-shadow: 0 0 30px rgba(var(--hc-primary-color-rgb, 139, 35, 50), 0.4);
}

/* Combined lift + subtle zoom */
.hc-child-page-card.hover-lift:hover .hc-child-page-image {
    transform: scale(1.05);
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

.hc-child-page-link:focus {
    outline: none;
}

.hc-child-page-link:focus-visible {
    outline: 3px solid var(--hc-accent-color, #c9a961);
    outline-offset: 2px;
}

.hc-child-page-card:focus-within {
    transform: translateY(-4px);
}

.hc-child-page-card:focus-within .hc-child-page-button-wrapper {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {
    .hc-child-page-title {
        font-size: 1.25rem;
    }

    .hc-child-page-content {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .hc-child-page-card {
        height: var(--card-height, 300px);
    }

    .hc-child-page-title {
        font-size: 2.5rem;
    }

    .hc-child-page-content {
        padding: 1rem;
    }

    /* Show button by default on mobile (no hover) */
    .hc-child-page-button-wrapper {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
    }

    /* Reduce lift effect on mobile */
    .hc-child-page-card.hover-lift:hover {
        transform: translateY(-4px);
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hc-child-page-card,
    .hc-child-page-image,
    .hc-child-page-overlay,
    .hc-child-page-button-wrapper {
        transition: none;
    }

    .hc-child-page-card.hover-lift:hover {
        transform: none;
    }

    .hc-child-page-card.hover-zoom:hover .hc-child-page-image {
        transform: none;
    }

    .hc-child-page-button-wrapper {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
    }
}
