/* ================================================================
   GSP Frontend Styles
   Supports two grid modes:
   - .gsp-grid--fill  → equal columns using --gsp-cols variable
   - .gsp-grid--auto  → auto-fill using --gsp-col-min variable
   ================================================================ */

.gsp-wrap {
    width: 100%;
    font-family: inherit;
    --gsp-accent: #4f46e5;
}

.gsp-section-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ---- Grid modes ---- */
.gsp-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1.5rem;
    display: grid;
}

/* Fill mode: fixed column count that stretches to fill */
.gsp-grid--fill {
    grid-template-columns: repeat(var(--gsp-cols, 3), 1fr);
}

/* Auto mode: as many cards as fit at the minimum width */
.gsp-grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(var(--gsp-col-min, 260px), 1fr));
}

/* Responsive overrides for fill mode */
@media (max-width: 900px) {
    .gsp-grid--fill { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .gsp-grid--fill { grid-template-columns: 1fr; }
    .gsp-grid--auto { grid-template-columns: 1fr; }
}

/* ---- Card ---- */
.gsp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.gsp-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* ---- Image ---- */
.gsp-card__image-wrap {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f4f6;
    text-decoration: none;
}

.gsp-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gsp-card:hover .gsp-card__image { transform: scale(1.03); }

/* ---- Placeholder ---- */
.gsp-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gsp-card__image-placeholder__letter {
    font-size: 3rem;
    font-weight: 700;
    color: #adb5bd;
    line-height: 1;
    user-select: none;
}

/* ---- Card body ---- */
.gsp-card__body {
    padding: 1rem 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

/* Category */
.gsp-card__category {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--gsp-accent);
    display: block;
    margin-bottom: 0.125rem;
}

/* Title */
.gsp-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #111827;
}

.gsp-card__title a {
    color: inherit;
    text-decoration: none;
}
.gsp-card__title a:hover { text-decoration: underline; }

/* Description */
.gsp-card__desc {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0.25rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.gsp-card__price {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0.25rem 0 0.5rem;
}

/* CTA Button */
.gsp-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--gsp-accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    margin-top: auto;
    transition: filter 0.18s ease, transform 0.12s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.gsp-card__btn:hover {
    filter: brightness(0.88);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.gsp-card__btn:active { transform: translateY(0); }

/* ---- Empty state ---- */
.gsp-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

/* ---- Admin notice (shown to admins on API errors) ---- */
.gsp-admin-notice {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: 0.875rem;
}

/* ---- Header row (title + "View all on Gumroad →") ---- */
.gsp-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.gsp-section-title { margin: 0; }

.gsp-view-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gsp-accent);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.gsp-view-all:hover { opacity: 0.75; text-decoration: none; }

/* ---- PAY WHAT YOU WANT badge ---- */
.gsp-card__image-wrap { position: relative; }

.gsp-card__pwyw-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--gsp-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
    user-select: none;
}
