/* EVV - Custom Plugin by RN20 - Frontend Styles */

/* Events List */
/* 1. Style de base (S'applique partout si non surchargé) */
.events-list {
    display: grid;
    /* On enlève le auto-fill qui sème la confusion */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    margin: 20px 0;
}

/* 2. Tablettes (1024px et moins) */
@media (max-width: 1024px) {
    .events-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 3. Mobiles (768px et moins) */
@media (max-width: 768px) {
    .events-list {
        grid-template-columns: 1fr !important; /* Le !important force la priorité sur l'inline */
        gap: 20px;
    }
    
    /* On réduit un peu l'image sur mobile pour ne pas qu'elle prenne tout l'écran */
    .event-thumbnail img {
        height: 180px;
    }
}

.event-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.event-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.event-item-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    text-decoration: none !important;
    color: inherit;
    outline: none;
}

.event-item-link:hover,
.event-item-link:focus,
.event-item-link:active,
.event-item-link:visited {
    text-decoration: none !important;
    color: inherit;
}

.event-item-link * {
    text-decoration: none !important;
}

.event-item-link:focus-visible {
    outline: 3px solid #007cba;
    outline-offset: 2px;
    border-radius: 8px;
}

.event-thumbnail {
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
}

.event-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
}

.event-item:hover .event-thumbnail img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.event-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px;
}

.event-title {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #359830;
    font-weight: 700;
    transition: color 0.3s ease;
}

.event-item:hover .event-title {
    color: #2d7d28;
}

.event-subtitle {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    min-height: 1.5em;
}

.event-date,
.event-location {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.event-excerpt {
    margin: 15px 0;
    color: #555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.event-actions {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Single Event Details */
.event-details {
    max-width: 800px;
    margin: 50px auto;
}

.event-visual {
    margin-bottom: 30px;
    text-align: center;
}

.event-visual img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.event-header {
    margin-bottom: 30px;
    text-align: center;
}

.event-details .event-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
}

.event-details .event-title-single {
    font-family: 'PT Sans', sans-serif;
    font-size: 50px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 0;
    color: #359830;
    line-height: 1.2;
}

.event-details .event-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.event-content {
    margin-bottom: 40px;
    line-height: 1.8;
}

.event-content p {
    margin-bottom: 1em;
}

/* Occurrences */
.event-occurrences {
    margin-top: 40px;
}

.event-occurrences h2 {
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    margin-bottom: 30px;
    color: #333;
}

.occurrence-item {

    border-radius: 8px;
    padding: 0px;
    margin-bottom: 130px !important;
}

.occurrence-info {
    margin-bottom: 30px;
}

.occurrence-date,
.occurrence-location,
.occurrence-capacity {
    margin-bottom: 15px;
    font-size: 1em;
}

.occurrence-date strong,
.occurrence-location strong,
.occurrence-capacity strong {
    color: #333;
}

.occurrence-registration h3 {
    margin-bottom: 20px;
    color: #007cba;
}

/* Registration Form */
.event-registration-form-wrapper {
    max-width: 600px;
    margin: 0 auto !important;
}

.event-registration-form {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 40px;
    box-shadow: none;
}

.event-registration-form .form-section {
    margin-bottom: 35px;
}

.event-registration-form .form-section h3 {
    margin-bottom: 20px;
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    color: #1a1a1a;
    font-size: 1.3em;
    font-weight: 600;
}

.event-registration-form .form-field {
    margin-bottom: 24px;
}

.event-registration-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 15px;
}

.event-registration-form .form-control {
    width: 100%;
    padding: 22px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 17px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-height: 56px;
}

.event-registration-form .form-control::placeholder {
    color: #999;
    opacity: 1;
    font-size: 17px;
}

.event-registration-form .form-control:hover {
    border-color: #bbb;
}

.event-registration-form .form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    background-color: #ffffff;
}

.event-registration-form textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.event-registration-form .required {
    color: #e74c3c;
    font-weight: 700;
}

.event-registration-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    line-height: 1.6;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.event-registration-form .checkbox-label:hover {
    background-color: #f8f9fa;
}

.event-registration-form .checkbox-label input {
    margin-right: 12px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.event-registration-form .radio-group {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-registration-form .radio-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.event-registration-form .radio-label:hover {
    background-color: #f8f9fa;
}

.event-registration-form .radio-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.event-registration-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 2l1.4-1.4L6 5.2l4.6-4.6L12 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.event-registration-form .form-actions {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.event-registration-form .button {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.event-registration-form .button-primary {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.event-registration-form .button-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004266 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.4);
}

.event-registration-form .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.event-registration-form .button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.event-registration-form .button-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Form Messages */
.form-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.form-message.success::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.form-message.error::before {
    content: "✕";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

/* Capacity Info */
.registration-capacity-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #d4e9ff 100%);
    border: none;
    border-left: 4px solid #007cba;
    color: #004085;
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 500;
}

.event-registration-full {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    border: none;
    border-left: 4px solid #c62828;
    font-weight: 500;
}

.registration-closed {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    color: #856404;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    border: none;
    border-left: 4px solid #ffc107;
    font-weight: 500;
}

/* No Events Message */
.no-events {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background: #e7e7e7;
    border-color: #bbb;
}

.button-primary {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {

    .event-details .event-title {
        font-size: 2em;
    }

    .event-details .event-title-single {
        font-size: 36px;
    }

    .occurrence-item {
        padding: 20px;
    }

    .event-registration-form {
        padding: 20px;
    }

    .event-actions {
        flex-direction: column;
    }

    .event-actions .button {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .event-content {
        padding: 15px;
    }

    .event-thumbnail img {
        height: 150px;
    }

    .event-item:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    }

    .event-details .event-title {
        font-size: 1.8em;
    }

    .event-details .event-title-single {
        font-size: 32px;
    }

    .event-registration-form .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Private Events - Blur & Overlay */
.event-private {
    position: relative;
    overflow: hidden;
}

/* Private Events - Lock badge on thumbnail (shortcode cards) */
.event-private .event-thumbnail,
.event-private .event-card-image {
    position: relative;
}

.event-private .event-private-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Private Posts - Lock badge next to title in Elementor grids */
.evv-lock-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 6px;
    background: #359830;
    border-radius: 50%;
    color: #fff;
}

/* Single page - Restricted content layout */
.evv-restricted {
    font-family: "PT Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}


/* Teaser: thumbnail visible on top, progressively blurred, CTA overlaid */
.evv-teaser {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.evv-teaser img {
    width: 100%;
    height: auto;
    display: block;
}

.evv-teaser-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.6) 12%,
        rgba(255,255,255,0.92) 24%,
        rgba(255,255,255,1) 36%
    );
    pointer-events: none;
}

.evv-teaser-cta {
    position: absolute;
    top: 22%;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 32px;
    z-index: 2;
}

.evv-teaser-cta-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: #359830;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(53, 152, 48, 0.25);
}

.evv-teaser-cta p {
    font-size: 16px;
    font-weight: 400;
    color: #555;
    line-height: 1.6;
    margin: 0 auto 6px;
    max-width: 420px;
}

.evv-teaser-cta p:first-of-type {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.evv-teaser-cta .evv-restricted-btn {
    margin-top: 24px;
    padding: 16px 44px;
    font-size: 16px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(53, 152, 48, 0.3);
    transition: all 0.25s ease;
}

.evv-teaser-cta .evv-restricted-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(53, 152, 48, 0.4);
}

@media (max-width: 600px) {
    .evv-teaser-cta {
        top: 28%;
        padding: 0 16px;
    }

    .evv-teaser-cta p {
        font-size: 14px;
    }

    .evv-teaser-cta p:first-of-type {
        font-size: 16px;
    }
}

/* CTA block (fallback without thumbnail) */
.evv-restricted-cta {
    text-align: center;
    padding: 0;
}

.evv-restricted-cta-inner {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 48px 36px;
}

.evv-restricted-cta-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.evv-restricted-cta-inner h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.evv-restricted-cta-inner p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 auto 28px;
    max-width: 460px;
}

.evv-restricted-btn {
    display: inline-block;
    padding: 14px 40px;
    background: #359830;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-family: "PT Sans", sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.evv-restricted-btn:hover {
    background: #2d7d28;
    color: #fff !important;
}


@media (max-width: 600px) {
    .evv-restricted-cta-inner {
        padding: 32px 20px;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .event-item,
    .event-thumbnail img,
    .event-title {
        transition: none;
    }

    .event-item:hover {
        transform: none;
    }

    .event-item:hover .event-thumbnail img {
        transform: none;
    }
}