/**
 * Planning Center Integration - Groups Styles
 *
 * @package PlanningCenterIntegration
 * @since 1.5.0
 */

/* Shared card styles */
.cctm-groups-row-wrap,
.pci-groups-wrap {
    position: relative;
}

.cctm-groups-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.cctm-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.cctm-arrows {
    display: flex;
    gap: 0.5rem;
}

.cctm-arrow {
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s, border-color 0.2s;
}

.cctm-arrow:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cctm-card,
.pci-group-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cctm-card-media {
    aspect-ratio: 6/2;
    background: #f3f4f6;
    display: grid;
    place-items: center;
}

.cctm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cctm-no-image {
    color: #9ca3af;
    font-size: 12px;
}

.cctm-card-body {
    padding: 1rem;
}

.cctm-card-title {
    margin: 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.cctm-card-meta {
    margin: 0 0 0.5rem;
    font-size: 12px;
    color: #4b5563;
}

.cctm-card-desc {
    margin: 0 0 0.75rem;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cctm-card-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
}

.cctm-card-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    text-decoration: none;
}

/* Row (horizontal gallery) layout */
.cctm-groups-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-right: 0.5rem;
    scroll-behavior: smooth;
}

.cctm-groups-row .cctm-card {
    min-width: 260px;
    max-width: 260px;
    scroll-snap-align: start;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Grid layout (using flexbox for centering single items) */
.cctm-grid {
    --cctm-gap: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--cctm-gap);
}

.cctm-grid .cctm-card {
    width: calc(50% - var(--cctm-gap) / 2);
    max-width: 450px;
}

@media (max-width: 640px) {
    .cctm-grid .cctm-card {
        width: 100%;
        max-width: none;
    }
}
