﻿/* ========================================================
   BDN - BULLETIN DE NOUVELLES
   Aligné avec la charte graphique du site (v2)
   Couleurs : #4b6cb7, #182848, #6580B6
   ======================================================== */

/* ===== PAGE HEADER ===== */
.bdn-page-header {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 26px 30px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 6px 24px rgba(24, 40, 72, 0.35);
    position: relative;
    overflow: hidden;
}

.bdn-page-header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bdn-page-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.bdn-page-header h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.bdn-page-header p {
    font-size: 13px;
    opacity: 0.72;
    margin: 0;
    letter-spacing: 0.5px;
}

.bdn-page-header-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.45);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.25s;
    white-space: nowrap;
}

.bdn-page-header-link:hover {
    background: rgba(255, 255, 255, 0.30);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* ===== CONTAINER ===== */
.bdn-container {
    max-width: 90%;
    margin: 20px auto;
}

/* ===== CONTROLS (retour archives) ===== */
.bdn-controls {
    text-align: center;
    margin-bottom: 20px;
}

.bdn-controls a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.28s;
    box-shadow: 0 3px 12px rgba(24, 40, 72, 0.25);
}

.bdn-controls a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 40, 72, 0.38);
}

/* ===== ITEM PRINCIPAL ===== */
.bdn-item {
    margin-bottom: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(75, 108, 183, 0.10);
}

/* ===== BARRE DATE / TITRE ===== */
.bdn-date {
    padding: 24px 24px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    font-size: 14px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.bdn-date-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.bdn-date-title .emoji {
    font-size: 20px;
}

/* ===== TITRE BDN ===== */
.bdn-bulletin-title {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    font-style: italic;
    font-size: 26px;
    line-height: 1.35;
}

.bdn-dropdown-wrap {
    display: flex;
    align-items: center;
}

/* ===== CUSTOM DROPDOWN ARCHIVES ===== */
.bdn-custom-select {
    position: relative;
    display: inline-block;
}

.bdn-custom-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.45);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    font-family: inherit;
}

.bdn-custom-select-btn:hover {
    background: rgba(255, 255, 255, 0.30);
    border-color: rgba(255, 255, 255, 0.8);
}

.bdn-cs-arrow {
    font-size: 14px;
    opacity: 0.8;
}

.bdn-custom-select-list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(24, 40, 72, 0.25);
    min-width: 220px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 999;
    border: 1px solid rgba(75, 108, 183, 0.15);
}

.bdn-custom-select-list.open {
    display: block;
}

.bdn-custom-select-item {
    display: block;
    padding: 10px 16px;
    color: #182848;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.18s;
    border-bottom: 1px solid rgba(75, 108, 183, 0.08);
}

.bdn-custom-select-item:last-child {
    border-bottom: none;
}

.bdn-custom-select-item:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    color: #4b6cb7;
}

.bdn-custom-select-item.selected {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
}

/* ===== CONTENU ===== */
.bdn-content {
    padding: 24px;
}

/* ===== VERSET ===== */
.bdn-verset {
    text-align: center;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 15px;
    position: relative;
}

.bdn-verset-texte {
    margin-bottom: 15px;
    line-height: 1.75;
}

.bdn-verset-ref {
    font-weight: 700;
    color: #4b6cb7;
    margin-top: 15px;
    font-size: 16px;
}

/* ===== WARNING / FALLBACK ===== */
.bdn-warning {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-left: 4px solid #ffc107;
    border-radius: 10px;
    color: #856404;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.15);
}

.bdn-warning strong {
    display: block;
    margin-bottom: 8px;
    color: #856404;
    font-size: 15px;
}

/* ===== BLOCS INFO (Commentaire / Echos) ===== */
.bdn-info-block {
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.65;
}

.bdn-info-block.commentaire {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border-left: 4px solid #6580B6;
}

.bdn-info-block.echo {
    background: linear-gradient(135deg, #e8f0ff 0%, #dde6ff 100%);
    border-left: 4px solid #4b6cb7;
}

.bdn-info-block strong {
    display: block;
    color: #182848;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.bdn-echo-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 700;
    color: #182848;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(75, 108, 183, 0.25);
}

/* ===== CARTES EN 3D FLIP ===== */
@keyframes bdnCardIn {
    from { opacity: 0; transform: translateY(22px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.bdn-cards-container {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bdn-card-flip {
    perspective: 1200px;
    height: 260px;
    cursor: pointer;
    opacity: 0;
    animation: bdnCardIn 0.5s ease forwards;
    transition: transform 0.3s ease;
}

.bdn-card-flip:nth-child(1) { animation-delay: 0.05s; }
.bdn-card-flip:nth-child(2) { animation-delay: 0.13s; }
.bdn-card-flip:nth-child(3) { animation-delay: 0.21s; }
.bdn-card-flip:nth-child(4) { animation-delay: 0.29s; }
.bdn-card-flip:nth-child(5) { animation-delay: 0.37s; }
.bdn-card-flip:nth-child(6) { animation-delay: 0.45s; }
.bdn-card-flip:nth-child(n+7) { animation-delay: 0.53s; }

.bdn-card-flip:not(.flipped):hover {
    transform: translateY(-6px);
}

.bdn-card-flip.wide {
    grid-column: 1 / -1;
}

.bdn-card-flip.medium {
    height: 130px;
}

.bdn-card-flip.medium .bdn-card-emoji {
    font-size: 32px;
    margin-bottom: 6px;
}

.bdn-card-flip.medium .bdn-card-title {
    font-size: 15px;
    margin-bottom: 2px;
}

.bdn-card-flip.medium .bdn-card-subtitle {
    font-size: 11px;
}

.bdn-card-flip.small {
    height: 65px;
}

.bdn-card-flip.small .bdn-card-emoji {
    font-size: 20px;
    margin-bottom: 2px;
}

.bdn-card-flip.small .bdn-card-title {
    font-size: 12px;
    margin-bottom: 0;
}

.bdn-card-flip.small .bdn-card-subtitle {
    display: none;
}

.bdn-card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    transform-style: preserve-3d;
}

.bdn-card-flip.flipped .bdn-card-flip-inner {
    transform: rotateY(180deg);
}

.bdn-card-front,
.bdn-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10), 0 8px 24px rgba(0,0,0,0.12);
    text-align: center;
    transition: box-shadow 0.4s;
    overflow: hidden;
}

.bdn-card-flip:hover .bdn-card-front,
.bdn-card-flip:hover .bdn-card-back {
    box-shadow: 0 4px 12px rgba(0,0,0,0.14), 0 18px 44px rgba(0,0,0,0.22);
}

.bdn-card-flip.flipped .bdn-card-front,
.bdn-card-flip.flipped .bdn-card-back {
    box-shadow:
        inset 0 0 0 2px rgba(212,175,55,0.95),
        0 0 0 2px rgba(212,175,55,0.95),
        0 0 0 6px rgba(212,175,55,0.30),
        0 4px 12px rgba(0,0,0,0.14), 0 18px 44px rgba(0,0,0,0.22);
}

/* Brillance subtile sur la face avant */
.bdn-card-front::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 52%;
    background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* Indicateur de flip */
.bdn-card-front::after {
    content: '↻';
    position: absolute;
    bottom: 9px;
    right: 12px;
    font-size: 15px;
    opacity: 0.40;
    transition: transform 0.4s ease, opacity 0.3s;
}

.bdn-card-flip:hover .bdn-card-front::after {
    transform: rotate(180deg);
    opacity: 0.75;
}

.bdn-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #1e3a6d 0%, #0f2244 100%);
    color: white;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 18px 20px;
}

/* Icône fermeture sur le dos */
.bdn-card-back::after {
    content: '✕';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 13px;
    opacity: 0.40;
    pointer-events: none;
    transition: opacity 0.2s;
}
.bdn-card-flip.flipped .bdn-card-back::after {
    opacity: 0.65;
}

.bdn-card-front.reunion {
    background: linear-gradient(145deg, #4b6cb7 0%, #182848 100%);
    color: white;
    justify-content: space-between;
}

.bdn-card-front.priere {
    background: linear-gradient(145deg, #6580B6 0%, #4b4b9e 100%);
    color: white;
}

.bdn-card-front.annonce {
    background: linear-gradient(145deg, #f37335 0%, #c94800 100%);
    color: white;
}

.bdn-card-front.fichier {
    background: linear-gradient(145deg, #3a86ff 0%, #0053c6 100%);
    color: white;
}

.bdn-card-emoji {
    font-size: 44px;
    margin-bottom: 14px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.30));
    transition: transform 0.3s ease;
}

.bdn-card-flip:not(.flipped):hover .bdn-card-emoji {
    transform: scale(1.14);
}

.bdn-card-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0px;
}

.bdn-card-subtitle {
    font-size: 12px;
    opacity: 0.80;
    letter-spacing: 0.5px;
    font-style: italic;
}

.bdn-card-back-content {
    font-size: 12px;
    line-height: 1.55;
    text-align: left;
    padding: 2px 0;
    width: 100%;
}

.bdn-card-back-content strong {
    display: inline;
    font-size: 13px;
    color: #aec6ff;
    margin-right: 3px;
    font-weight: 700;
}

.bdn-card-back-content ul {
    white-space: normal;
    margin: 10px 0;
    padding-left: 24px;
}

.bdn-card-back-content li {
    white-space: normal;
    margin: 6px 0;
}

.bdn-card-back-content a {
    color: #cfe2ff;
    text-decoration: underline;
    font-weight: 600;
}

/* ===== IMAGE ===== */
.bdn-image {
    text-align: center;
}

.bdn-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

/* ===== SELECT ARCHIVES ===== */
select[name="archive-select"] {
    padding: 8px 14px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: white;
    min-width: 200px;
    transition: all 0.25s;
}

select[name="archive-select"] option {
    background: #182848;
    color: white;
}

select[name="archive-select"]:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.8);
}

select[name="archive-select"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ===== AUCUN BDN ===== */
.no-bdn {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    font-size: 16px;
}

/* ===== LISTE ARCHIVES ===== */
.archives-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.archive-item {
    background: white;
    border: 2px solid rgba(75, 108, 183, 0.12);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
}

.archive-item:hover {
    box-shadow: 0 6px 20px rgba(75, 108, 183, 0.2);
    transform: translateY(-3px);
    border-color: #4b6cb7;
}

.archive-date {
    font-weight: 700;
    color: #182848;
    margin-bottom: 8px;
    font-size: 15px;
}

.archive-type {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e8ecff 0%, #dde4ff 100%);
    color: #4b6cb7;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ===== TITRE ARCHIVES ===== */
.bdn-archives-title {
    font-size: 20px;
    font-weight: 800;
    color: #182848;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #4b6cb7;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
    .bdn-container {
        max-width: 96%;
        margin: 12px auto;
    }

    .bdn-page-header {
        padding: 18px 16px 14px;
        border-radius: 12px;
        gap: 14px;
    }

    .bdn-page-header h1 {
        font-size: 17px;
    }

    .bdn-page-header-icon {
        width: 42px;
        height: 42px;
        font-size: 22px;
        border-radius: 10px;
    }

    .bdn-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 18px;
    }

    .bdn-card-flip { height: 230px; }
    .bdn-card-flip.medium { height: 110px; }
    .bdn-card-flip.medium .bdn-card-emoji { font-size: 28px; margin-bottom: 4px; }
    .bdn-card-flip.medium .bdn-card-title { font-size: 13px; }
    .bdn-card-flip.small { height: 50px; }
    .bdn-card-flip.small .bdn-card-emoji { font-size: 16px; margin-bottom: 1px; }
    .bdn-card-flip.small .bdn-card-title { font-size: 11px; }
    .bdn-card-flip.small .bdn-card-subtitle { display: none; }
    .bdn-card-emoji { font-size: 38px; margin-bottom: 10px; }
    .bdn-card-title { font-size: 15px; }
    .bdn-card-back-content { font-size: 12px; }

    .bdn-date {
        align-items: center;
        text-align: center;
    }

    .bdn-bulletin-title {
        font-size: 17px;
    }

    .bdn-date-title {
        justify-content: center;
    }

    .bdn-dropdown-wrap {
        justify-content: center;
        width: 100%;
    }

    .bdn-custom-select-list {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    select[name="archive-select"] {
        min-width: 150px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .bdn-container {
        max-width: 100%;
        margin: 8px 0;
    }

    .bdn-page-header {
        padding: 14px 12px 12px;
        border-radius: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .bdn-page-header-link {
        width: 100%;
        justify-content: center;
    }

    .bdn-cards-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .bdn-card-flip { height: 210px; }
    .bdn-card-flip.medium { height: 100px; }
    .bdn-card-flip.medium .bdn-card-emoji { font-size: 26px; margin-bottom: 3px; }
    .bdn-card-flip.small { height: 46px; }
    .bdn-card-flip.small .bdn-card-emoji { font-size: 14px; margin-bottom: 1px; }
    .bdn-card-flip.small .bdn-card-title { font-size: 10px; }
    .bdn-card-emoji { font-size: 34px; }
    .bdn-card-title { font-size: 13px; }

    .bdn-date {
        padding: 12px 14px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }

    .bdn-date-title { font-size: 14px; justify-content: center; }
    .bdn-content { padding: 14px; }

    select[name="archive-select"] {
        min-width: 100%;
        font-size: 11px;
    }
}