/**
 * Highlights Component - News/Events/Offers Grid Widget
 *
 * Displays highlights in a grid/carousel layout
 * Uses global colors from foundations/colors.css
 * Uses global typography from foundations/typography.css
 * Uses global buttons from components/buttons.css
 *
 * @package Kurpfalz_Theme
 * @author Saad Badr
 * @copyright 2025 SawatzkiMühlenbruch GmbH
 */

/* ============================================
   Highlights - Widget-specific styles
   ============================================ */

/* Widget Wrapper */
.kurpfalz-highlights-wrapper {
    padding-top: var(--widget-margin-top); /* Responsive: prevents logo overlap */
    padding-bottom: 0;
}

/* Background colors - use global .frame-background-* classes from foundations/colors.css */

/* Header with Title */
.kurpfalz-highlights-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-left: var(--margin-horizontal);
    margin-right: var(--margin-horizontal);
    margin-bottom: var(--spacing-md);
}

.kurpfalz-highlights-header h2 {
    /* Inherits global widget heading styles from widget-headings.css */
    margin-top: 0; /* Override for header context */
}

/* Grid Container */
.kurpfalz-highlights-grid {
    margin-left: var(--margin-horizontal);
    margin-right: var(--margin-horizontal);
    position: relative;
}

/* Grid Inner */
.kurpfalz-highlights-grid-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: left;
    margin-bottom: 0;
}

/* Action Button Container - positioned at bottom right */
.kurpfalz-highlights-action {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    margin-right: var(--margin-horizontal);
    margin-bottom: var(--spacing-xl);
}

/* Action Button (like huge-link) */
.kurpfalz-highlights-action-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--hugelink-color);
    font-weight: var(--font-weight-light);
    font-size: var(--font-size-h2);
    text-transform: uppercase;
    transition: all var(--transition-fast);
    /* Inherits text-decoration: none from global a */
}

.kurpfalz-highlights-action-button:hover {
    color: var(--hugelink-color);
    font-weight: var(--font-weight-medium);
}

.kurpfalz-highlights-action-button svg {
    height: 50px;
    width: 20px;
    transition: transform 0.3s ease;
}

.kurpfalz-highlights-action-button:hover svg {
    transform: translateX(5px);
}

/* Highlight Card - Exact copy of .news-list-item */
.kurpfalz-highlight-card {
    width: var(--max-width-card);
    aspect-ratio: 1/1;
    height: auto;
    max-width: 100%;
    position: relative;
    border-bottom-right-radius: var(--border-radius-lg);
    overflow: hidden;
}

/* Card Picture - Exact copy of .news-list-item-picture */
.kurpfalz-highlight-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.kurpfalz-highlight-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Content (only visible if enabled in settings) */
.kurpfalz-highlight-card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--spacing-md);
    z-index: 1;
    pointer-events: none;
}

.kurpfalz-highlight-card-content > * {
    pointer-events: auto;
}

.kurpfalz-highlight-card-subtitle {
    background-color: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-highlight);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    text-transform: uppercase;
    align-self: flex-start;
}

.kurpfalz-highlight-card-title {
    background-color: rgba(44, 16, 76, 0.9);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-medium);
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
}

/* Hide default content on hover when overlay is shown */
.kurpfalz-highlight-card:hover .kurpfalz-highlight-card-content {
    opacity: 0;
}

/* Card Overlay (shown on hover) */
.kurpfalz-highlight-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 400ms;
    background-color: var(--color-secondary);
    box-sizing: border-box;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 2;
}

.kurpfalz-highlight-card:hover .kurpfalz-highlight-card-overlay {
    opacity: 1;
}

/* Overlay Time */
.kurpfalz-highlight-card-overlay time {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    display: block;
}

/* Overlay Title */
.kurpfalz-highlight-card-overlay h3 {
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0 0 var(--spacing-md) 0;
}

/* Overlay Description */
.kurpfalz-highlight-card-overlay div[itemprop="description"] {
    font-size: var(--font-size-small);
    color: var(--color-primary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

.kurpfalz-highlight-card-overlay div[itemprop="description"] p {
    margin: 0 0 var(--spacing-xs) 0;
}

/* More Button - uses global .btn class from components/buttons.css */
.kurpfalz-highlight-card-overlay .btn.more {
    align-self: flex-start;
    margin-top: auto;
}

/* Responsive - No grid columns needed with flexbox */
@media (max-width: 750px) {
    .kurpfalz-highlights-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .kurpfalz-highlights-action-button {
        font-size: var(--font-size-large);
    }
}

@media (max-width: 540px) {
    .kurpfalz-highlights-header h2 {
        font-size: var(--font-size-large);
    }

    .kurpfalz-highlights-action-button {
        font-size: var(--font-size-contact-h3);
    }
}
