/** source/_static/css/widgets/panel.css **/

/********************************/
/* ------- Panel Cards -------- */
/********************************/

.panel-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.panel-card-link {
    text-decoration: none;
    border-bottom: none !important;
    display: block;
    flex: 1 1 300px; /* Base size for flex items */
    max-width: 350px;
    aspect-ratio: 4 / 3; /* Ensures uniform card shape */
}

.panel-card-link:hover {
    border-bottom: none;
}

.panel-card {
    position: relative; /* Context for absolute children */
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden; /* Keeps children within the rounded corners */
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: flex-end; /* Aligns title content to the bottom */
    justify-content: center; /* Aligns title content to the center */
}

.panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(179, 157, 219, 0.4); /* Shadow uses AmnesiaPurple */
}

/* 1. Panel image covers the entire card */
.panel-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* Sits at the bottom of the stack */
    transition: transform 0.4s ease;
}

.panel-card:hover .panel-card-image {
    transform: scale(1.05); /* Subtle zoom on hover */
}

/* 2. Color overlay with hover animation */
.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* --color-primary-light (#B39DDB) with 25% alpha */
    background-color: rgba(179, 157, 219, 0.25); 
    z-index: 2; /* Sits above the image */
    
    /* The magic: transition the clip-path property */
    transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Default state: A large circle covers the whole element */
    clip-path: circle(142% at 50% 50%);
}

.panel-card:hover::before {
    /* Hover state: The circle shrinks to nothing at the center */
    clip-path: circle(0% at 50% 50%);
}

/* 3. Panel title superimposed on the image */
.panel-card-content {
    position: relative;
    z-index: 3; /* Sits on top of the overlay and image */
    width: 100%;
    padding: 1.25rem 1.5rem;
    /* Add a gradient for text readability against any image */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    box-sizing: border-box;
}

.panel-card-title {
    font-family: var(--font-family-heading);
    color: var(--color-text-primary);
    font-size: 1.3rem;
    margin: 0;
    line-height: var(--line-height-dense);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6); /* Further improves readability */
}