/* ==========================================================================
   Jeu concours – Calendrier de Noël 2026
   Charte du calendrier imprimé (bleu nuit, Instrument Serif romain/italique,
   pointillés) appliquée à une mise en page web : accroche centrée, grand
   calendrier, dock flottant.
   Toutes les règles sont préfixées par .noel2026 (surcouche Bootstrap 5 + thème).
   ========================================================================== */

.noel2026 {
    /* --- Palette (relevée sur le print) --- */
    --nuit: #173461;        /* fond */
    --encre: #0f2547;       /* dock, modales, dos des cases */
    --vermillon: #ef4a2b;   /* rouge des illustrations */
    --dragee: #f5b6c4;      /* rose des illustrations */
    --ocre: #c8a36a;        /* pointillés */
    --ligne: rgba(255, 255, 255, .16);
    --blanc: #ffffff;
    --blanc-doux: rgba(255, 255, 255, .78);

    /* --- Typo --- */
    --serif: 'Instrument Serif', 'Playfair Display', Georgia, serif;
    --sans: 'Montserrat', system-ui, sans-serif;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --dock-h: 76px;

    display: block;
    background: var(--nuit);
    color: var(--blanc);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: calc(var(--dock-h) + 4rem);
}

/* ---------- Neutralise les règles globales du thème ----------
   common.css : p, div { color:#000; font-size:14px }
   pre-style.css : button { background:#000; padding:10px 40px; text-transform:uppercase; font-weight:700 }
   pre-style.css : ol, ul { margin… ; list-style… } */
.noel2026 div,
.noel2026 p,
.noel2026 li,
.noel2026 span,
.noel2026 label {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-align: inherit;
}

.noel2026 button {
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--sans);
    font-weight: inherit;
    line-height: 1.2;
    border-radius: 0;
}

.noel2026 ol,
.noel2026 ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ----------------------------- Typo de titrage ----------------------------- */
.noel2026 .noel-display {
    font-family: var(--serif);
    font-weight: 400 !important;
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -.01em;
    color: var(--blanc);
    margin: 0 0 1.25rem;
    text-wrap: balance;
}

.noel2026 .noel-display em { font-style: italic; }

.noel2026 .noel-display--xl {
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: .98;
    letter-spacing: -.02em;
    margin-bottom: 1.5rem;
}

.noel2026 .noel-display--sm {
    font-size: 1.9rem;
    margin: 0;
}

.noel2026 .noel-text {
    max-width: 34em;
    margin: 0 0 1rem;
    color: var(--blanc-doux);
}

.noel2026 .noel-text--sm { font-size: .875rem; }

/* ----------------------------- Accroche ----------------------------- */
.noel2026 .noel-hero {
    max-width: 58rem;
    margin: 0 auto;
    padding: 4rem 16px 2.5rem;
    text-align: center;
}

/* Titre : dates en très grand, puis "Grand jeu de Noël 2026" */
.noel2026 .noel-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.75rem;
}

.noel2026 .noel-title .noel-title-name {
    display: block;
    margin: 0;
}

.noel2026 .noel-title-dates sup {
    position: relative;
    top: -.5em;
    vertical-align: baseline;
    margin-left: .05em;
    font-size: .65em;
    line-height: 0;
    letter-spacing: .04em;
    text-transform: lowercase;
}

.noel2026 .noel-kicker {
    display: block;
    font-family: var(--sans);
    font-size: clamp(.95rem, 1.6vw, 1.15rem);
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dragee);
}

.noel2026 .noel-lead {
    max-width: 36em;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--blanc);
}

.noel2026 .noel-lead strong {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.25em;
}

/* Les 3 lots du tirage au sort : pastilles pointillées */
.noel2026 .noel-prizes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
    margin-top: 1.5rem;
}

.noel2026 .noel-prizes li {
    padding: .35rem 1.1rem .45rem;
    border: 1px dashed var(--ocre);
    border-radius: 999px;
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.2;
    color: var(--blanc);
}

/* ----------------------------- Bandeau d'info ----------------------------- */
.noel2026 .noel-notice {
    max-width: min(40rem, calc(100% - 32px));
    margin: 0 auto 2rem;
    padding: .9rem 1.1rem;
    border-left: 3px solid var(--dragee);
    background: rgba(255, 255, 255, .06);
    font-size: .9rem;
}

.noel2026 .noel-notice p { margin: 0; }
.noel2026 .noel-notice p + .noel-text-btn { margin-top: .4rem; }

/* ----------------------------- Calendrier ----------------------------- */
.noel2026 .noel-board {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}

.noel2026 .noel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 576px) {
    .noel2026 .noel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}

@media (min-width: 992px) {
    .noel2026 .noel-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
}

.noel2026 .noel-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    perspective: 900px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* Ouverture du calendrier : seule animation au chargement */
    animation: noel-in .5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 25ms);
}

.noel2026 .noel-tile-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform .7s var(--ease);
}

.noel2026 .noel-tile.is-flipped .noel-tile-inner {
    transform: rotateY(180deg);
}

.noel2026 .noel-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 4px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.noel2026 .noel-face-front {
    background: var(--tile-bg, var(--encre));
    color: var(--tile-fg, #fff);
    transition: transform .25s var(--ease), opacity .25s, filter .25s, box-shadow .25s;
}

.noel2026 .noel-face-front img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

/* Fallback sans image : cadre pointillé + numéro (comme les visuels) */
.noel2026 .noel-face-front::before {
    content: '';
    position: absolute;
    inset: 14% 12%;
    border: 1px dashed currentColor;
    opacity: .45;
    pointer-events: none;
}

.noel2026 .noel-tile-number {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    line-height: 1;
    pointer-events: none;
}

.noel2026 .noel-tile.has-image .noel-tile-number,
.noel2026 .noel-tile.has-image .noel-face-front::before {
    display: none;
}

/* Pastille d'ordre de sélection */
.noel2026 .noel-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--vermillon);
    color: #fff;
    font-family: var(--serif);
    font-size: 1.1rem;
    line-height: 1;
    transform: scale(0);
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
    z-index: 2;
}

@media (hover: hover) {
    .noel2026 .noel-grid:not(.is-locked) .noel-tile:hover .noel-face-front {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
    }
}

.noel2026 .noel-tile:focus-visible {
    outline: 2px solid var(--dragee);
    outline-offset: 3px;
}

/* Sélectionnée : liseré blanc intérieur + pastille */
.noel2026 .noel-tile.is-selected .noel-face-front {
    box-shadow: inset 0 0 0 4px var(--blanc);
}

.noel2026 .noel-tile.is-selected .noel-badge { transform: scale(1); }

/* 3 cases choisies ou partie terminée : les autres s'effacent */
.noel2026 .noel-grid.is-full .noel-tile:not(.is-selected) .noel-face-front,
.noel2026 .noel-grid.is-locked .noel-tile:not(.is-selected) .noel-face-front {
    opacity: .35;
    filter: saturate(.6);
}

.noel2026 .noel-grid.is-locked .noel-tile { cursor: default; }

/* Dos des cases (révélation) */
.noel2026 .noel-face-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: 14%;
    text-align: center;
    background: var(--encre);
    color: var(--blanc);
    font-family: var(--serif);
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    line-height: 1.1;
}

.noel2026 .noel-face-back::before {
    content: '';
    position: absolute;
    inset: 9%;
    border: 1px dashed var(--ocre);
}

.noel2026 .noel-face-back small {
    font-family: var(--sans);
    font-size: clamp(.6rem, 1.1vw, .75rem);
    line-height: 1.3;
}

.noel2026 .noel-face-back.is-win { background: var(--vermillon); }
.noel2026 .noel-face-back.is-win::before { border-color: rgba(255, 255, 255, .7); }

/* ----------------------------- Comment jouer ----------------------------- */
.noel2026 .noel-how {
    max-width: 1160px;
    margin: 5rem auto 0;
    padding: 0 16px;
    text-align: center;
}

.noel2026 .noel-steps {
    display: grid;
    gap: 1.5rem;
    margin-top: .5rem;
    text-align: left;
}

@media (min-width: 768px) {
    .noel2026 .noel-steps { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (min-width: 1100px) {
    .noel2026 .noel-steps { grid-template-columns: repeat(4, 1fr); }
}

.noel2026 .noel-steps li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--ligne);
}

.noel2026 .noel-step-num {
    flex: 0 0 auto;
    font-family: var(--serif);
    font-style: italic;
    font-size: 3rem;
    line-height: .8;
    color: var(--dragee);
}

.noel2026 .noel-steps p {
    margin: 0;
    font-size: .95rem;
    color: var(--blanc-doux);
}

.noel2026 .noel-steps strong {
    color: var(--blanc);
    font-weight: 600;
}

/* ----------------------------- Règlement ----------------------------- */
.noel2026 .noel-rules {
    max-width: 44rem;
    margin: 5rem auto 0;
    padding: 0 16px;
    text-align: center;
}

.noel2026 .noel-rules-list {
    margin: 0 auto 1.5rem;
    max-width: 34em;
    color: var(--blanc-doux);
    font-size: .9rem;
    text-align: left;
}

.noel2026 .noel-rules-list li {
    position: relative;
    padding-left: 1.25rem;
}

/* Puce : petit trait pointillé, comme les lignes de découpe du print */
.noel2026 .noel-rules-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .8em;
    width: .7rem;
    border-top: 1px dashed var(--ocre);
}

.noel2026 .noel-rules-list li + li { margin-top: .5rem; }

/* Contenu saisi dans l'admin (éditeur Froala) : le texte collé depuis Outlook / le web
   arrive avec des styles en ligne (fond blanc, Segoe UI, gris, centrage, majuscules).
   On les neutralise pour que le bloc suive la charte de la page. */
.noel2026 .noel-rules-content {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px dashed var(--ligne);
    border-radius: 12px;
    text-align: left;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--blanc-doux);
}

.noel2026 .noel-rules-content * {
    background: transparent !important;
    color: inherit !important;
    font-family: var(--sans) !important;
    font-size: inherit !important;
    font-style: normal !important;
    line-height: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: left !important;
    border: 0 !important;
}

.noel2026 .noel-rules-content p,
.noel2026 .noel-rules-content span[style*="display: block"] {
    margin: 0 0 .5rem !important;
}

/* Paragraphes vides (<p><br></p>) et sauts de ligne isolés : on supprime les trous */
.noel2026 .noel-rules-content p:has(> br:only-child),
.noel2026 .noel-rules-content span:has(> br:only-child) {
    display: none !important;
}

/* Titres : style des titres de la page */
.noel2026 .noel-rules-content h1,
.noel2026 .noel-rules-content h2,
.noel2026 .noel-rules-content h3 {
    margin: 1.25rem 0 .5rem !important;
    font-family: var(--serif) !important;
    font-weight: 400 !important;
    font-size: 1.6rem !important;
    line-height: 1.15 !important;
    color: var(--blanc) !important;
}

.noel2026 .noel-rules-content h4,
.noel2026 .noel-rules-content h5,
.noel2026 .noel-rules-content strong,
.noel2026 .noel-rules-content b {
    color: var(--blanc) !important;
    font-weight: 600 !important;
}

.noel2026 .noel-rules-content a {
    color: var(--dragee) !important;
    text-decoration: underline;
}

.noel2026 .noel-rules-content > :first-child { margin-top: 0 !important; }
.noel2026 .noel-rules-content > :last-child { margin-bottom: 0 !important; }

/* ----------------------------- Boutons ----------------------------- */
.noel2026 .noel-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 48px;
    padding: .75rem 1.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--blanc);
    color: var(--nuit);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background-color .2s, color .2s, transform .15s;
}

.noel2026 .noel-cta:hover:not(:disabled) { background: var(--dragee); }
.noel2026 .noel-cta:active:not(:disabled) { transform: scale(.97); }

.noel2026 .noel-cta:disabled {
    background: transparent;
    color: rgba(255, 255, 255, .45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
    cursor: not-allowed;
}

.noel2026 .noel-text-btn {
    background: none;
    border: 0;
    padding: .25rem 0;
    color: var(--blanc);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
    cursor: pointer;
}

.noel2026 .noel-text-btn:disabled {
    opacity: .4;
    cursor: default;
}

.noel2026 :focus-visible {
    outline: 2px solid var(--dragee);
    outline-offset: 3px;
}

/* ----------------------------- Emplacements (dock + formulaire) ----------------------------- */
.noel2026 .noel-slots {
    display: flex;
    gap: 8px;
}

.noel2026 .noel-slot {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border: 1px dashed var(--ocre);
    border-radius: 6px;
    overflow: hidden;
}

.noel2026 .noel-slot img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

.noel2026 .noel-slot .noel-slot-num {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: 1.4rem;
}

.noel2026 .noel-slot.is-filled {
    border: 2px solid var(--blanc);
    animation: noel-drop .35s var(--ease) both;
}

.noel2026 .noel-slots--form { margin-bottom: 1.25rem; }
.noel2026 .noel-slots--form .noel-slot { width: 72px; height: 72px; }

/* ----------------------------- Dock ----------------------------- */
.noel2026 .noel-dock {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1040; /* sous les modales Bootstrap (1055) */
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(620px, calc(100% - 24px));
    min-height: var(--dock-h);
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--ligne);
    border-radius: 18px;
    background: var(--encre);
    box-shadow: 0 16px 40px rgba(5, 15, 35, .45);
}

.noel2026 .noel-dock-hint {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: .875rem;
    line-height: 1.35;
    color: var(--blanc-doux);
}

/* Partie jouée ou jeu fermé : plus d'action possible */
.noel2026.is-locked .noel-dock .noel-cta,
.noel2026.is-locked .noel-dock-reset {
    display: none;
}

@media (max-width: 575.98px) {
    .noel2026 { --dock-h: 68px; }

    .noel2026 .noel-dock {
        gap: .6rem;
        bottom: calc(10px + env(safe-area-inset-bottom));
        padding: 8px;
        border-radius: 14px;
    }

    .noel2026 .noel-dock .noel-slots { gap: 5px; }
    .noel2026 .noel-dock .noel-slot { width: 44px; height: 44px; }
    .noel2026 .noel-dock-hint { font-size: .78rem; }
    .noel2026 .noel-dock-reset { display: none; }
    .noel2026 .noel-dock .noel-cta { min-height: 44px; padding: .5rem 1rem; }
    .noel2026 .noel-hero { padding-top: 2.5rem; }
}

/* Le badge Calendly du footer chevaucherait le dock sur petit écran */
@media (max-width: 767.98px) {
    body .calendly-badge-widget { display: none; }
}

/* Jusqu'à 768px, le thème affiche en bas de l'écran la barre fixe
   "Contact / Téléphone" (.ctas, 64px de haut – voir resp.css et style.css).
   Le dock se place juste au-dessus, et la page réserve la place des deux. */
@media (max-width: 768px) {
    .noel2026 {
        --theme-bar: 64px;
        padding-bottom: calc(var(--theme-bar) + var(--dock-h) + 3rem);
    }

    .noel2026 .noel-dock {
        bottom: calc(var(--theme-bar) + 8px);
    }
}

/* ----------------------------- Modales ----------------------------- */
.noel2026 .noel-modal .modal-content {
    background: var(--encre);
    color: var(--blanc);
    border: 1px solid var(--ligne);
    border-radius: 18px;
}

.noel2026 .noel-modal .modal-header,
.noel2026 .noel-modal .modal-footer {
    border: 0;
    padding: 1.5rem 1.5rem .5rem;
}

.noel2026 .noel-modal .modal-footer {
    padding: .5rem 1.5rem 1.5rem;
    gap: 1rem;
}

.noel2026 .noel-modal .modal-body { padding: 1rem 1.5rem; }

.noel2026 #noelWinModal .modal-body,
.noel2026 #noelLoseModal .modal-body,
.noel2026 #noelPlayedModal .modal-body {
    padding: 2.5rem 2rem;
    text-align: center;
}

.noel2026 #noelWinModal .noel-text,
.noel2026 #noelLoseModal .noel-text,
.noel2026 #noelPlayedModal .noel-text {
    margin-left: auto;
    margin-right: auto;
}

.noel2026 .noel-modal--win .modal-content {
    background: var(--vermillon);
    border-color: transparent;
}

.noel2026 .noel-modal--win .noel-text { color: #fff; }
.noel2026 .noel-modal .noel-cta { margin-top: .75rem; }

.noel2026 .noel-prize {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.15;
    margin: 0 0 1.25rem;
}

.noel2026 .noel-modal .form-label {
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: .35rem;
}

.noel2026 .noel-modal .form-control {
    min-height: 46px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #fff;
    color: var(--encre);
    font-size: 1rem;
}

.noel2026 .noel-modal .form-control:focus {
    border-color: var(--dragee);
    box-shadow: 0 0 0 3px rgba(245, 182, 196, .45);
}

.noel2026 .noel-modal .form-check-label { font-size: .875rem; }

.noel2026 .noel-modal .form-check-input:checked {
    background-color: var(--vermillon);
    border-color: var(--vermillon);
}

.noel2026 .noel-modal .invalid-feedback {
    color: var(--dragee);
    font-size: .8rem;
}

.noel2026 .noel-modal .was-validated .form-control:invalid,
.noel2026 .noel-modal .form-control.is-invalid {
    border-color: var(--dragee);
    background-image: none;
}

.noel2026 .noel-modal .was-validated .form-check-input:invalid ~ .form-check-label {
    color: var(--dragee);
}

/* Champ piège anti-robots : hors écran (pas display:none, que certains robots détectent) */
.noel2026 .noel-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.noel2026 .noel-legal {
    margin: 1rem 0 0;
    font-size: .75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .6);
}

.noel2026 .noel-legal a {
    color: inherit;
    text-decoration: underline;
}

.noel2026 .noel-form-error {
    margin: 1rem 0 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--dragee);
    background: rgba(255, 255, 255, .06);
    font-size: .875rem;
}

/* ----------------------------- Animations ----------------------------- */
@keyframes noel-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@keyframes noel-drop {
    from { opacity: 0; transform: scale(.7); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .noel2026 .noel-tile,
    .noel2026 .noel-slot.is-filled { animation: none; }
    .noel2026 .noel-tile-inner,
    .noel2026 .noel-face-front,
    .noel2026 .noel-badge { transition: none; }
}
