/* =========================================================
   EVENTS PAGE
   ========================================================= */

.vignes-events-grid {
    width: min(1200px, 100%);
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 360px));
    justify-content: center;
    gap: 30px;
    box-sizing: border-box;
}

/* Event card */

.vignes-event-card {
    display: block;
    width: 100%;
    max-width: 360px;
    min-height: 380px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
    background: #fffdf8;
    border: 1px solid #c9b79c;
    border-radius: 2px;
    box-shadow: 0 6px 16px rgba(70, 40, 20, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vignes-event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(70, 40, 20, 0.25);
}

/* Event image */

.vignes-event-image {
    width: 100%;
    height: 190px;
    overflow: hidden;
    box-sizing: border-box;
    background: linear-gradient(135deg, #722f37, #d19a62);
    border: 1px solid rgba(114, 47, 55, 0.18);
}

.vignes-event-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) sepia(0.06);
}

/* Event content */

.vignes-event-content {
    display: block;
    padding: 20px 16px 14px !important;
    box-sizing: border-box;
}

.vignes-event-title {
    margin: 0 0 18px !important;
    color: #722f37 !important;
    font-family: Georgia, serif;
    font-size: 28px !important;
    line-height: 1.2;
    text-align: center;
}

.vignes-event-date {
    display: block !important;
    width: max-content !important;
    margin: 0 auto 18px !important;
    padding: 8px 14px;
    color: #ffffff !important;
    background: #722f37;
    border-radius: 20px;
    font-size: 14px !important;
    font-weight: bold;
    text-align: center;
}

.vignes-event-region {
    margin-bottom: 16px;
    color: #765d4d;
    font-size: 16px !important;
}

.vignes-event-organiser {
    margin-bottom: 8px;
    color: #765d4d;
    font-size: 14px !important;
    font-style: italic;
}

.vignes-event-description {
    margin-top: 20px;
    color: #403832;
    font-size: 16px !important;
    line-height: 1.6;
}

.vignes-event-button {
    display: block;
    width: max-content;
    margin: 24px auto 0;
    padding: 12px 22px;
    color: #ffffff !important;
    background: #c0392b;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none !important;
}

.vignes-event-button:hover {
    background: #922b21;
}

/* =========================================================
   MODIFIER AND SUPPRIMER BUTTONS
   ========================================================= */

/* Modifier link */

.vignes-edit-button,
.vignes-modify-button,
a[href*="edit"],
a[href*="modifier"] {
    display: inline-block !important;
    box-sizing: border-box !important;
    margin: 2px 4px !important;
    padding: 6px 14px !important;
    min-height: 28px !important;

    color: #722f37 !important;
    background: #ffffff !important;
    border: 1px solid #722f37 !important;
    border-radius: 4px !important;

    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* Supprimer button, input or link */

.vignes-delete-button,
.vignes-remove-button,
button.delete,
button.supprimer,
button[name="delete"],
button[name="supprimer"],
button[value="delete"],
button[value="supprimer"],
input.delete,
input.supprimer,
input[name="delete"],
input[name="supprimer"],
input[value="Supprimer"],
input[value="SUPPRIMER"],
a[href*="delete"],
a[href*="supprimer"] {
    display: inline-block !important;
    box-sizing: border-box !important;
    margin: 2px 4px !important;
    padding: 6px 14px !important;
    min-height: 28px !important;

    color: #722f37 !important;
    background: #ffffff !important;
    border: 1px solid #722f37 !important;
    border-radius: 4px !important;

    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    appearance: none !important;
}

/* Same hover effect */

.vignes-edit-button:hover,
.vignes-modify-button:hover,
.vignes-delete-button:hover,
.vignes-remove-button:hover,
a[href*="edit"]:hover,
a[href*="modifier"]:hover,
button.delete:hover,
button.supprimer:hover,
button[name="delete"]:hover,
button[name="supprimer"]:hover,
button[value="delete"]:hover,
button[value="supprimer"]:hover,
input.delete:hover,
input.supprimer:hover,
input[name="delete"]:hover,
input[name="supprimer"]:hover,
input[value="Supprimer"]:hover,
input[value="SUPPRIMER"]:hover,
a[href*="delete"]:hover,
a[href*="supprimer"]:hover {
    color: #ffffff !important;
    background: #722f37 !important;
    border-color: #722f37 !important;
}

/* Empty events message */

.vignes-events-empty {
    max-width: 700px;
    margin: 40px auto;
    padding: 25px;
    background: #fff5e6;
    border-left: 5px solid #722f37;
}

/* Google Maps button */

.vignes-event-location {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.vignes-google-maps-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    margin-left: 4px;

    background: #2b6cb0;
    border-radius: 50%;

    color: #ffffff !important;
    font-size: 18px;
    line-height: 1;
    text-decoration: none !important;
}

.vignes-google-maps-button:hover,
.vignes-google-maps-button:focus {
    background: #1e4e80;
    transform: scale(1.05);
}

/* Create/modify event form */

.vignes-events-form {
    max-width: 700px;
}

.vignes-events-crud h2 {
    color: #722f37;
    font-family: Georgia, serif;
    margin-bottom: 20px;
}

.vignes-events-table {
    border-collapse: collapse;
}

.vignes-events-table th,
.vignes-events-table td {
    padding: 8px 14px;
    text-align: left;
}

/* Below phone-portrait width, stop forcing a horizontal scroll (or a
   rotate-to-landscape) to reach the Actions column — each row becomes its
   own card, label above value, with Modifier/Supprimer/Architecture set
   apart at the bottom. Standard responsive-table pattern, driven by the
   data-label attribute each <td> already carries. */
@media (max-width: 640px) {
    .vignes-events-table thead {
        display: none;
    }

    .vignes-events-table,
    .vignes-events-table tbody,
    .vignes-events-table tr,
    .vignes-events-table td {
        display: block;
        width: 100%;
    }

    .vignes-events-table tr {
        margin-bottom: 16px;
        padding: 10px 14px;
        background: #fffdf8;
        border: 1px solid #c9b79c;
        border-radius: 6px;
    }

    .vignes-events-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        text-align: right;
    }

    .vignes-events-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        color: #765d4d;
        font-weight: 600;
    }

    .vignes-events-table td:last-child {
        justify-content: flex-end;
        flex-wrap: wrap;
        margin-top: 6px;
        padding-top: 10px;
        border-top: 1px solid #e4d9c4;
    }

    .vignes-events-table td:last-child::before {
        content: none;
    }
}

/* Grey/italic placeholder look for any dropdown still on its blank
   "Sélectionner…" option — swaps back to normal styling the moment a real
   value is chosen, since it targets whichever option is currently checked. */
.vignes-events-crud select:has(option[value=""]:checked) {
    font-style: italic;
    color: #9c8b7a;
}

.vignes-events-message {
    max-width: 700px;
    margin: 0 0 20px;
    padding: 14px 18px;
    background: #fff5e6;
    border-left: 5px solid #722f37;
    color: #4a2e1a;
    border-radius: 2px;
}

.vignes-events-form {
    /* Procedural light-oak wood grain (SVG feTurbulence, tuned to a warm
       oak tone via feColorMatrix, stitched so the 300px tile repeats with
       no visible seam) instead of a flat fill. */
    background-color: #ecdcc2;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27300%27%20height%3D%27300%27%3E%0A%3Cfilter%20id%3D%27w%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27300%27%20height%3D%27300%27%20filterUnits%3D%27userSpaceOnUse%27%3E%0A%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.1%200.015%27%20numOctaves%3D%274%27%20seed%3D%2712%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%0A%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%270.35%200%200%200%200.55%20%200.22%200%200%200%200.40%20%200.10%200%200%200%200.24%20%200%200%200%200.6%200%27%2F%3E%0A%3C%2Ffilter%3E%0A%3Crect%20width%3D%27300%27%20height%3D%27300%27%20filter%3D%27url(%23w)%27%2F%3E%0A%3C%2Fsvg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
    border: 1px solid #d9bf98;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(70, 40, 20, 0.08);
    padding: 28px 24px;
}

.vignes-events-form p {
    margin: 0 0 20px;
}

/* Submit/Annuler pair — flex+gap gives consistent spacing whether they sit
   side by side or wrap to stacked rows on a narrow screen, unlike a plain
   margin-left which disappears once the buttons wrap. */
.vignes-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.vignes-events-form label {
    display: block;
    font-weight: 600;
    color: #765d4d;
    font-size: 14px;
    margin-bottom: 6px;
}

/* Regular field labels wrap their input directly (label > text, br, input),
   so their visual gap comes from line-height, not margin. This label is a
   separate element from the box that follows it, so it needs a smaller
   explicit margin to visually match that tighter line-height-driven gap. */
.vignes-events-form p.vignes-wine-group-label {
    display: block;
    font-weight: 600;
    color: #765d4d;
    font-size: 14px;
    margin-bottom: 2px;
}

.vignes-events-form input:not([type="hidden"]),
.vignes-events-form select,
.vignes-events-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 16px;
    color: #403832;
    background: #ffffff;
    border: 1px solid #c9b79c;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vignes-events-form input::placeholder {
    color: #a89a89;
    opacity: 1;
}

.vignes-events-form input:not([type="hidden"]):focus,
.vignes-events-form select:focus,
.vignes-events-form textarea:focus {
    outline: none;
    border-color: #722f37;
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.12);
}

.vignes-events-form input[disabled] {
    background: #f1eee8;
    color: #765d4d;
    border-style: dashed;
}

.vignes-events-form input[type="file"] {
    padding: 8px;
    background: #fffdf8;
    cursor: pointer;
}

.vignes-events-form textarea {
    min-height: 180px;
    resize: vertical;
}

.vignes-events-form small {
    display: block;
    margin-top: 6px;
    color: #999;
    font-size: 12px;
}

.vignes-events-form button[type="submit"] {
    display: inline-block;
    color: #ffffff !important;
    border: none;
    padding: 12px 28px;
    min-width: 210px;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: filter 0.2s ease;
}

/* Same procedural wood-grain technique as the form panel background,
   recoloured to a dark stained-mahogany tone so white button text stays
   legible — same grain pattern (baseFrequency/octaves/seed), different
   feColorMatrix output. */
.vignes-events-form button[type="submit"],
.vignes-vigneron-nav .vignes-event-button {
    background-color: #4a1d24;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27300%27%20height%3D%27300%27%3E%0A%3Cfilter%20id%3D%27w%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27300%27%20height%3D%27300%27%20filterUnits%3D%27userSpaceOnUse%27%3E%0A%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.1%200.015%27%20numOctaves%3D%274%27%20seed%3D%2712%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%0A%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%270.24%200%200%200%200.36%20%200.14%200%200%200%200.12%20%200.14%200%200%200%200.15%20%200%200%200%200.7%200%27%2F%3E%0A%3C%2Ffilter%3E%0A%3Crect%20width%3D%27300%27%20height%3D%27300%27%20filter%3D%27url(%23w)%27%2F%3E%0A%3C%2Fsvg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
}

.vignes-events-form button[type="submit"]:hover {
    filter: brightness(85%);
}

.vignes-events-cancel {
    display: inline-block;
    padding: 12px 28px;
    min-width: 210px;
    text-align: center;
    /* White base with the same wood-grain pattern laid over it at low
       opacity (feColorMatrix alpha 0.28, vs 0.6 on the form panel) — a
       hint of grain rather than a solid tan fill, keeping the button
       reading as white. */
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27300%27%20height%3D%27300%27%3E%0A%3Cfilter%20id%3D%27w%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27300%27%20height%3D%27300%27%20filterUnits%3D%27userSpaceOnUse%27%3E%0A%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.1%200.015%27%20numOctaves%3D%274%27%20seed%3D%2712%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%0A%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%270.35%200%200%200%200.55%20%200.22%200%200%200%200.40%20%200.10%200%200%200%200.24%20%200%200%200%200.28%200%27%2F%3E%0A%3C%2Ffilter%3E%0A%3Crect%20width%3D%27300%27%20height%3D%27300%27%20filter%3D%27url(%23w)%27%2F%3E%0A%3C%2Fsvg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
    color: #722f37 !important;
    border: 1px solid #722f37;
    border-radius: 5px;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none !important;
    cursor: pointer;
    transition: filter 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}

.vignes-events-cancel:hover {
    /* Same dark mahogany wood as the submit button on hover, for a matched pair. */
    background-color: #4a1d24;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27300%27%20height%3D%27300%27%3E%0A%3Cfilter%20id%3D%27w%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27300%27%20height%3D%27300%27%20filterUnits%3D%27userSpaceOnUse%27%3E%0A%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.1%200.015%27%20numOctaves%3D%274%27%20seed%3D%2712%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%0A%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%270.24%200%200%200%200.36%20%200.14%200%200%200%200.12%20%200.14%200%200%200%200.15%20%200%200%200%200.7%200%27%2F%3E%0A%3C%2Ffilter%3E%0A%3Crect%20width%3D%27300%27%20height%3D%27300%27%20filter%3D%27url(%23w)%27%2F%3E%0A%3C%2Fsvg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
    color: #ffffff !important;
}

/* Two fields sharing one row (e.g. Code postal + Ville) */

.vignes-events-form-row {
    display: flex;
    gap: 16px;
}

.vignes-events-form-row > p,
.vignes-events-form-row > div {
    flex: 1;
    min-width: 0;
}

.vignes-events-form-row > .vignes-form-col-1of3 {
    flex: 1;
}

.vignes-events-form-row > .vignes-form-col-2of3 {
    flex: 2;
}

.vignes-events-form-row > .vignes-form-col-1of2 {
    flex: 1;
}

@media (max-width: 480px) {
    .vignes-events-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Mon Domaine - title can be long, keep it readable rather than oversized */

.vignes-vigneron-title {
    font-size: 22px !important;
    line-height: 1.3;
    word-break: break-word;
    margin-bottom: 0 !important;
}

.vignes-required-warning {
    color: #c0392b;
    font-style: normal;
    font-weight: 800;
}

.vignes-vigneron-coords-note {
    margin: 4px 0 0 !important;
    color: #722f37;
    font-size: 13px;
    font-style: italic;
    font-weight: 600;
}

.vignes-vigneron-interface {
    margin-top: 24px;
}

/* Mon Domaine - navigation hub + title + form layout.
   Mobile-first: stacked in one column, nav above the title above the form.
   From 900px up (ample desktop width) the nav becomes a stacked sidebar to
   the left, with the title and form stacked in the remaining column. */

.vignes-vigneron-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
}

.vignes-vigneron-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.vignes-vigneron-main {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.vignes-vigneron-nav .vignes-event-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    text-align: center;
    transition: filter 0.2s ease;
}

.vignes-vigneron-nav .vignes-event-button:hover {
    filter: brightness(85%);
}

/* "Mon Interface" - top of the nav, half the height of the other buttons
   (52px -> 26px) and stained red instead of mahogany. Same wood-grain
   pattern (baseFrequency/octaves/seed), recoloured via feColorMatrix. */
.vignes-vigneron-nav .vignes-event-button.vignes-event-button-home {
    padding: 0 22px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    background-color: #a51c24;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27300%27%20height%3D%27300%27%3E%0A%3Cfilter%20id%3D%27w%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27300%27%20height%3D%27300%27%20filterUnits%3D%27userSpaceOnUse%27%3E%0A%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.1%200.015%27%20numOctaves%3D%274%27%20seed%3D%2712%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%0A%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%270.30%200%200%200%200.55%20%200.10%200%200%200%200.03%20%200.10%200%200%200%200.05%20%200%200%200%200.7%200%27%2F%3E%0A%3C%2Ffilter%3E%0A%3Crect%20width%3D%27300%27%20height%3D%27300%27%20filter%3D%27url(%23w)%27%2F%3E%0A%3C%2Fsvg%3E");
}

@media (min-width: 900px) {
    .vignes-vigneron-layout {
        flex-direction: row;
        align-items: flex-start;
        max-width: 920px;
    }

    .vignes-vigneron-nav {
        flex: 0 0 200px;
    }

    .vignes-vigneron-main {
        flex: 1 1 auto;
    }
}

.vignes-event-button-disabled {
    background: #c9b79c !important;
    color: #fffdf8 !important;
    cursor: not-allowed;
}

.vignes-event-button-disabled:hover {
    background: #c9b79c !important;
}

/* Tablet */

@media (max-width: 950px) {
    .vignes-events-grid {
        grid-template-columns: repeat(2, minmax(280px, 360px));
    }
}

/* Mobile */

@media (max-width: 650px) {
    .vignes-events-grid {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .vignes-event-card {
        max-width: 360px;
        margin: 0 auto;
    }
}

/* =========================================================
   NOS APPELLATIONS / NOS IGP / NOS VDF — wine entry forms
   ========================================================= */

.vignes-wine-checkbox-group {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #f8f0e4;
    border: 1px solid #d9bf98;
    border-radius: 4px;
}

.vignes-wine-legend-hint {
    color: #9c8b7a;
    font-weight: 400;
    font-size: 12px;
}

.vignes-wine-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 14px 4px 0;
    font-weight: 400 !important;
    color: #403832;
}

.vignes-wine-checkbox input[type="checkbox"] {
    width: auto;
}