/* ============================================================
   Horse Contest — Le Cheval du Mois
   Fichier : assets/css/components/horse-contest.css
   Charge via inc/enqueue.php (même mécanisme que banner-seasonal)
   ============================================================ */

/* ── Section wrapper ────────────────────────────────────────── */
.bcc-contest {
    padding: 5rem 0 4rem;
    background: #eeece8; /* hsl(var(--muted)) exacto de Lovable: hsl(40,15%,92%) */
}

.bcc-contest__container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── En-tête ────────────────────────────────────────────────── */
.bcc-contest__header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Badge orange pulsant */
.bcc-contest__badge-wrap {
    margin-bottom: 1rem;
}

.bcc-contest__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 1.125rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #fff;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    animation: bcc-badge-pulse 2.5s ease-in-out infinite;
}

@keyframes bcc-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.045); }
}

.bcc-contest__title {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--bcc-foreground, #1E2D26);
    line-height: 1.1;
    margin: 0 0 0.875rem;
}

.bcc-contest__subtitle {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 1rem;
    color: #5a6a65;
    max-width: 42rem;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

.bcc-contest__subtitle strong {
    color: var(--bcc-foreground, #1E2D26);
}

/* Botón "Participer au concours" — hsl(--primary) exacto de Lovable: hsl(179,35%,67%) */
.bcc-contest .bcc-contest__participate-btn,
button.bcc-contest__participate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: #8dc8c7;
    background-color: #8dc8c7;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-family: var(--bcc-font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s;
    box-shadow: 0 4px 14px rgba(141,200,199,0.4);
}
.bcc-contest .bcc-contest__participate-btn:hover,
button.bcc-contest__participate-btn:hover {
    background: #7ab8b7;
    background-color: #7ab8b7;
    color: #fff;
    transform: translateY(-1px);
}
.bcc-contest .bcc-contest__participate-btn:active,
button.bcc-contest__participate-btn:active {
    transform: scale(0.97);
}

/* ── Gagnant mois précédent ─────────────────────────────────── */
.bcc-contest__winner {
    display: flex;
    flex-direction: column;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 2px solid #fcd34d;
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.12);
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .bcc-contest__winner {
        flex-direction: row;
    }
}

.bcc-contest__winner-photo {
    flex-shrink: 0;
    width: 100%;
}
@media (min-width: 768px) {
    .bcc-contest__winner-photo {
        width: 36%;
    }
}

.bcc-contest__winner-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bcc-contest__winner-content {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.375rem;
}

.bcc-contest__winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fde68a;
    color: #92400e;
    border-radius: 999px;
    padding: 0.25rem 0.875rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
    margin-bottom: 0.375rem;
}

.bcc-contest__winner-name {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bcc-foreground, #1E2D26);
    margin: 0;
}

.bcc-contest__winner-owner {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    color: #8a9e99;
    margin: 0;
}

.bcc-contest__winner-desc {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.9375rem;
    color: #3d5248;
    margin: 0.375rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}

/* ── Grille candidatures ────────────────────────────────────── */
.bcc-contest__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 600px) {
    .bcc-contest__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bcc-contest__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Card candidature ───────────────────────────────────────── */
.bcc-contest-card {
    background: #fff;
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(12, 72, 89, 0.08);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease;
}

.bcc-contest-card:hover {
    box-shadow: 0 6px 28px rgba(12, 72, 89, 0.14);
}

/* Bandeau rouge motivationnel */
.bcc-contest-card__banner {
    background: var(--bcc-conseil, #DA053A);
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.775rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Photo */
.bcc-contest-card__photo {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.bcc-contest-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.bcc-contest-card:hover .bcc-contest-card__photo img {
    transform: scale(1.04);
}

/* Corps */
.bcc-contest-card__body {
    padding: 1rem 1.125rem 1.125rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
}

.bcc-contest-card__name {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bcc-foreground, #1E2D26);
    text-align: center;
    margin: 0.125rem 0 0;
}

.bcc-contest-card__owner {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    color: #8a9e99;
    text-align: right;
    margin: 0;
}

.bcc-contest-card__desc {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    color: #4d6860;
    line-height: 1.5;
    margin: 0.375rem 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rangée vote */
.bcc-contest-card__vote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.875rem;
}

.bcc-contest-card__vote-count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    color: #6b7f79;
}

.bcc-contest-card__vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    border: none;
    background: var(--bcc-cta, #188A81);
    color: #fff;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.bcc-contest-card__vote-btn:hover:not(:disabled) {
    background: #126e67;
    transform: scale(1.03);
}

.bcc-contest-card__vote-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.bcc-contest-card__vote-btn--voted,
.bcc-contest-card__vote-btn:disabled {
    background: #e2eceb;
    color: #5a7872;
    cursor: not-allowed;
    transform: none;
}

/* Partage */
.bcc-contest-card__share {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-top: 0.625rem;
    border-top: 1px solid #eef2f1;
    margin-top: 0.625rem;
}

.bcc-contest-card__share-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.75rem;
    color: #8a9e99;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.bcc-contest-card__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.4rem;
    border: none;
    background: transparent;
    color: #8a9e99;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.bcc-contest-card__share-btn--fb:hover  { color: #1877F2; background: #edf4ff; }
.bcc-contest-card__share-btn--wa:hover  { color: #25D366; background: #edfaf3; }
.bcc-contest-card__share-btn--x:hover   { color: var(--bcc-foreground, #1E2D26); background: #f3f4f6; }
.bcc-contest-card__share-btn--copy:hover{ color: var(--bcc-cta, #188A81); background: #e8f4f3; }

/* ── État vide ──────────────────────────────────────────────── */
.bcc-contest__empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: #6b7f79;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 1rem;
    line-height: 1.6;
}

.bcc-contest__empty-sub {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ── Dialog (modale) ────────────────────────────────────────── */
.bcc-contest-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bcc-contest-dialog--open {
    pointer-events: auto;
    opacity: 1;
}

.bcc-contest-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 24, 18, 0.55);
    backdrop-filter: blur(3px);
}

.bcc-contest-dialog__panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.bcc-contest-dialog--open .bcc-contest-dialog__panel {
    transform: translateY(0);
}

.bcc-contest-dialog__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    color: #4b5563;
    transition: background 0.2s;
}

.bcc-contest-dialog__close:hover {
    background: #e5e7eb;
}

.bcc-contest-dialog__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.bcc-contest-dialog__title {
    font-family: var(--bcc-font-serif, 'Playfair Display', serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bcc-foreground, #1E2D26);
    margin: 0;
}

.bcc-contest-dialog__desc {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    color: #6b7f79;
    margin: 0 0 1.25rem;
}

/* Formulaire */
.bcc-contest-dialog__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bcc-contest-form__group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.bcc-contest-form__group label {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bcc-foreground, #1E2D26);
}

.bcc-contest-form__hint {
    font-weight: 400;
    color: #8a9e99;
}

.bcc-contest-form__group input[type="text"],
.bcc-contest-form__group input[type="email"],
.bcc-contest-form__group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #d1dbd8;
    border-radius: 0.625rem;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.9375rem;
    color: var(--bcc-foreground, #1E2D26);
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.bcc-contest-form__group input:focus,
.bcc-contest-form__group textarea:focus {
    outline: none;
    border-color: var(--bcc-cta, #188A81);
    box-shadow: 0 0 0 3px rgba(24, 138, 129, 0.12);
}

.bcc-contest-form__group textarea {
    resize: vertical;
    min-height: 7rem;
}

/* Upload photo */
.bcc-contest-form__file-input {
    display: none;
}

.bcc-contest-form__file-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border: 1.5px dashed #c4d4d1;
    border-radius: 0.625rem;
    cursor: pointer;
    color: #6b7f79;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.875rem;
    transition: background 0.2s, border-color 0.2s;
}

.bcc-contest-form__file-label:hover {
    background: #f0f7f6;
    border-color: var(--bcc-cta, #188A81);
}

/* Erreurs */
.bcc-contest-form__error {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.8125rem;
    color: var(--bcc-conseil, #DA053A);
    min-height: 1rem;
}

/* Feedback global */
.bcc-contest-form__feedback {
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    min-height: 1rem;
}

.bcc-contest-form__feedback--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.bcc-contest-form__feedback--error {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

/* Bouton submit */
.bcc-contest-form__submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}

/* ── Toast ──────────────────────────────────────────────────── */
.bcc-contest-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    z-index: 10000;
    background: var(--bcc-foreground, #1E2D26);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 999px;
    font-family: var(--bcc-font-sans, 'DM Sans', sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.bcc-contest-toast--error {
    background: var(--bcc-conseil, #DA053A);
}

.bcc-contest-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── No-scroll body ─────────────────────────────────────────── */
.bcc-contest-no-scroll {
    overflow: hidden;
}

/* ── Accessibilité ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bcc-contest__badge { animation: none; }
    .bcc-contest-card__photo img { transition: none; }
    .bcc-contest-dialog,
    .bcc-contest-dialog__panel { transition: none; }
}
