/* =========================================================
   1. RESET & BASE
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================================
   2. CONTENEURS GÉNÉRAUX
   ========================================================= */
.container {
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

.container-no-border {
    border: none !important;
}

/* =========================================================
   3. TABLEAUX GLOBAUX + TABLEAU COMMENTAIRES
   ========================================================= */
table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

th,
td {
    word-wrap: break-word;
    overflow: hidden;
    text-align: center;
}

/* cellules de données */
td {
    vertical-align: top !important;
    text-align: left;
}

/* en-têtes */
th {
    background-color: #90B3E1;
    color: #fff;
    border: 1px solid #666666;
    text-align: center;
}

/* lignes alternées */
tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Table commentaires (.cmt-table) */
.cmt-table td,
.cmt-table th {
    vertical-align: middle;
    padding: 10px 12px;
    word-break: break-word;
}

.cmt-table th {
    white-space: nowrap;
}

/* pastille admin */
.badge-admin {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 10px;
    background: #0d6efd;
    color: #fff;
    margin-left: 6px;
}

/* =========================================================
   4. ACTIONS / BOUTONS / FORMULAIRES DANS LES TABLEAUX
   ========================================================= */
/* cellules avec actions */
td.actions,
td.custom-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 10px;
}

/* formulaires internes */
td.actions form,
td.custom-actions form {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* boutons génériques */
button,
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    margin: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

/* variantes Bootstrap-like */
.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background-color: #a71d2a;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}
.btn-success:hover {
    background-color: #218838;
}

/* largeur fixe pour colonne actions */
th.actions,
td.custom-actions {
    width: 190px;
    text-align: center;
    vertical-align: middle;
    padding: 8px;
    box-sizing: border-box;
}

/* boutons dans formulaires d'action */
button,
.action-form button {
    display: inline-flex;
    padding: 8px 12px;
    white-space: nowrap;
    box-sizing: border-box;
}

.action-form {
    width: 100%;
    margin: 0;
}

/* même largeur pour certains boutons d'action */
.action-btn {
    min-width: 90px;
    text-align: center;
}

/* =========================================================
   NAVIGATION ADMIN — VERSION AMÉLIORÉE & PLUS JOLIE
   ========================================================= */

.navbar.admin-nav {
    background: #075E9F;
    border: none;
    border-radius: 10px;
    padding: 0 15px;
    margin-bottom: 25px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Marque (E.R.E.T. Admin) */
.navbar.admin-nav .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    padding: 18px 15px;
    font-size: 19px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Alignement horizontal du menu */
.navbar.admin-nav .navbar-nav {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 10px;
}

/* Style des liens */
.navbar.admin-nav .navbar-nav > li > a {
    color: #fff !important;
    padding: 18px 12px !important;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
}

/* Hover */
.navbar.admin-nav .navbar-nav > li > a:hover,
.navbar.admin-nav .navbar-nav > li > a:focus,
.navbar.admin-nav .navbar-nav > .open > a {
    background: rgba(255,255,255,0.22) !important;
    color: #fff !important;
}

/* Dropdown */
.navbar.admin-nav .dropdown-menu {
    border-radius: 6px;
    padding: 5px 0;
}

/* Bouton mobile */
.navbar.admin-nav .navbar-toggle .icon-bar {
    background-color: #fff;
}

/* Arrondir le coin inférieur gauche et droit */
.navbar.admin-nav {
    border-radius: 12px;
}

/* Empêche le menu de casser la ligne */
.navbar.admin-nav .navbar-nav > li {
    white-space: nowrap;
}

/* =========================================================
   6. HEADER / NAV VISITEUR + FOOTER
   ========================================================= */
/* en-tête visiteur */
.header-container {
    background-color: #f8f9fa;
    padding: 15px 0;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* barre nav visiteur */
.nav-container {
    background-color: #2A3F54;
    border-radius: 15px;
    padding: 10px 15px;
}

.nav-container .navbar-nav > li > a {
    color: #fff !important;
    font-size: 16px;
    font-weight: bold;
}

.nav-container .navbar-nav > li > a:hover {
    background-color: #075E9F;
    border-radius: 8px;
    color: #FFD700 !important;
}

/* pieds de page (visiteur + admin) */
.footer-container,
.footer-admin-container {
    color: #fff;
    background-color: #90B3E1;
    border: 1px solid #075E9F;
    margin-top: 15px;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.footer-links a,
.footer-admin-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 8px;
    font-weight: 500;
}

.footer-links a:hover,
.footer-admin-links a:hover {
    text-decoration: underline;
    color: #FFD700;
}

/* liens internes dans certains footers (liste) */
.footer-link {
    color: #f1f1f1;
    text-decoration: none;
    display: block;
    padding: 2px 0;
    transition: color 0.2s ease;
}
.footer-link:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* =========================================================
   7. IMAGES, BOUTONS CUSTOM, LOADER GLOBAL
   ========================================================= */
.img-container {
    text-align: center;
}
.img-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* boutons custom simples */
.btn-custom {
    background-color: #90B3E1;
    color: #fff;
    border: none;
    padding: 8px 12px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
}
.btn-custom:hover {
    background-color: #2A3F54;
}

/* overlay de chargement */
#loading {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================================
   8. PAGE : MEMBRES-CONSEIL-GESTION
   ========================================================= */
.membre-cadre {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px solid #075E9F;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 10px;
    width: 100%;
}

.image-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.membre-name,
.function-name {
    margin: 5px 0;
    font-weight: bold;
}

.image-container img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.image-container a {
    color: red;
    text-decoration: none;
    margin-top: 10px;
}
.image-container a:hover {
    color: darkred;
    text-decoration: underline;
}

/* étoile champ obligatoire */
.champ-obligatoire {
    color: red;
    font-size: 18px;
    vertical-align: super;
}

/* contenu central un peu plus grand */
.col-sm-9 {
    font-size: 18px;
    line-height: 1.7;
}

/* =========================================================
   9. BLOG
   ========================================================= */
.blog-grid {
    margin-top: 10px;
}
.blog-card {
    margin-bottom: 20px;
}
.blog-card .panel-body {
    min-height: 160px;
}
.blog-card img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.blog-card .label-date {
    display: inline-block;
    margin-bottom: 8px;
}
.blog-card .blog-title {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}
.blog-card .blog-excerpt {
    color: #333;
}
.blog-empty {
    padding: 30px;
    text-align: center;
    color: #666;
    border: 1px dashed #ccc;
    border-radius: 6px;
}

/* =========================================================
   10. CONDITIONS D’UTILISATION
   ========================================================= */
.page-title {
    margin: 0;
}
.page-subtitle {
    margin: 5px 0 0 0;
    letter-spacing: .03em;
}
.legal-wrapper {
    margin-top: 20px;
}
.panel-legal {
    border-color: #e5e5e5;
}
.panel-legal > .panel-heading {
    background: #fafafa;
    border-color: #e5e5e5;
}
.legal-section + .legal-section {
    margin-top: 18px;
}
.legal-section h3 {
    margin-top: 0;
    font-weight: 600;
}
.legal-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}
.legal-section ul {
    padding-left: 18px;
    margin-top: 8px;
}
.legal-badge {
    margin-right: 6px;
}
.toc .list-group-item {
    padding: 8px 10px;
}
.toc .list-group-item small {
    color: #666;
}
.last-update {
    color: #777;
    margin: 6px 0 0 0;
}

/* impression : on masque navigation, boutons, etc. */
@media print {
    .navbar,
    .jumbotron,
    .btn,
    .panel-footer,
    .col-sm-3,
    .toc {
        display: none !important;
    }

    a[href]:after {
        content: "";
    }

    body {
        font-size: 12pt;
    }
}

/* =========================================================
   11. PAGE CONTACT
   ========================================================= */
.contact-hero .jumbotron {
    margin-bottom: 0;
    padding: 20px;
}

.contact-card {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 20px;
}

.contact-card .panel-heading {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.contact-badge {
    margin-right: 6px;
}
.contact-help {
    color: #666;
}
.required {
    color: #d9534f;
}

.antispam-box {
    border: 2px solid #075E9F;
    border-radius: 10px;
    padding: 12px;
    background: #f8fbff;
}

/* info-card (contact) – attention : redéfinie plus bas pour l’orga */
.info-card {
    background: #f5f9ff;
    border: 1px solid #cfe3ff;
    border-radius: 8px;
    padding: 12px;
    color: #0a2a4d;
}
.info-card h4 {
    margin-top: 0;
}

.map-placeholder {
    background: linear-gradient(135deg,#eaf3ff,#f7fbff);
    border: 1px dashed #bcd3f5;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    color: #557;
}

.form-horizontal .control-label {
    text-align: left;
}
.has-error .help-block {
    color: #d9534f;
}

/* =========================================================
   12. HISTOIRE DE NOTRE EGLISE (TIMELINE)
   ========================================================= */
.timeline {
    padding-left: 70px !important;
}
.timeline:before {
    left: 32px !important;
}
.timeline-item {
    padding-left: 12px !important;
}
.timeline-item:before {
    left: 26px !important;
    z-index: 1 !important;
}
.timeline-item h4,
.timeline-item p {
    position: relative;
    z-index: 2;
}

/* =========================================================
   13. NOTRE ORGANISATION (CARDS, CONSEIL, PASTEURS)
   ========================================================= */
/* Hero organisation */
.hero {
    margin-bottom: 0;
    padding: 24px 16px;
}
.hero .jumbotron-title {
    margin: 0;
}
.hero .jumbotron-subtitle {
    margin: 4px 0 0;
    font-weight: 600;
    letter-spacing: .5px;
}

/* Cards organisation */
.card {
    background: #fff;
    border: 1px solid #e6eef4;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    margin-bottom: 18px;
}
.card .card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eef3f8;
    font-weight: 600;
    color: #075E9F;
}
.card .card-body {
    padding: 16px;
}
.card .card-footer {
    padding: 12px 16px;
    border-top: 1px solid #eef3f8;
    background: #fafcff;
}

/* Pastor */
.pastor-media {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pastor-media img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e6eef4;
}

@media (max-width:480px) {
    .pastor-media {
        flex-direction: column;
        align-items: flex-start;
    }
    .pastor-media img {
        width: 72px;
        height: 72px;
    }
}

/* Grille conseil */
.council-grid {
    margin-left: -10px;
    margin-right: -10px;
}
.council-item {
    padding: 10px;
}

.council-card {
    border: 1px solid #e7edf6;
    border-radius: 12px;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.council-card .thumb-wrap {
    position: relative;
    padding-top: 62%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f6f9fd;
}

/* neutralise ancienne règle trop large */
.council-card img {
    position: static;
    width: auto;
    height: auto;
}

/* nouvelle image de carte */
.council-card img.thumb {
    position: static !important;
    inset: auto !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 0;
}

.council-card .c-body {
    padding: 12px 14px;
    flex: 1;
}
.council-card .role {
    color: #075E9F;
    font-weight: 600;
    margin: 0 0 6px;
}
.council-card .person {
    margin: 0 0 6px;
    font-size: 15px;
}
.council-card .tel {
    color: #667085;
    font-size: 13px;
    margin: 0;
}

/* 1/1 (xs), 1/2 (sm), 1/3 (md+) */
@media (max-width:767px) {
    .council-col {
        width: 100%;
        float: none;
    }
}
@media (min-width:768px) and (max-width:991px) {
    .council-col {
        width: 50%;
        float: left;
    }
}
@media (min-width:992px) {
    .council-col {
        width: 33.3333%;
        float: left;
    }
}

/* Info card droite (écrase la précédente .info-card) */
.info-card {
    background: #90B3E1;
    color: #fff;
    border: 2px solid #075E9F;
    border-radius: 15px;
    padding: 12px;
}
.info-card a {
    color: #fff;
    text-decoration: underline;
}

/* liste stylée */
.bullet-list {
    padding-left: 18px;
}
.bullet-list li {
    margin-bottom: 6px;
}


/* Carte "Dernières actualités" */
.actu-thumb {
    width: 100%;
    max-width: 320px;          /* ou 100% si tu préfères */
    overflow: hidden;          /* cache ce qui dépasse */
    border-radius: 6px;
    margin-bottom: 8px;
}

.actu-thumb img {
    display: block;
    width: 100%;               /* prend toute la largeur de la carte */
    height: 180px;             /* hauteur fixe pour toutes les vignettes */
    object-fit: cover;         /* recadre l'image dans ce cadre */
}

/* Images dans les pages de détail d’actualités */
.actu-detail img.img-responsive {
    width: 100%;
    height: 380px;      /* ou 420px si tu préfères une image plus majestueuse */
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* --- Table pasteurs : mode "cartes" sur petits écrans --- */
@media (max-width: 768px){

  .pastors-table thead{
    display:none;
  }

  .pastors-table,
  .pastors-table tbody,
  .pastors-table tr,
  .pastors-table td{
    display:block;
    width:100%;
  }

  .pastors-table tr{
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    margin:12px 0;
    overflow:hidden;
  }

  .pastors-table td{
    border:none !important;
    border-top:1px solid #eee !important;
    padding:10px 12px !important;
  }

  .pastors-table td:first-child{
    border-top:none !important;
  }

  /* Labels (Titre / Nom / Informations / Photo) */
  .pastors-table td:nth-child(1)::before{ content:"Titre : "; font-weight:700; }
  .pastors-table td:nth-child(2)::before{ content:"Nom : "; font-weight:700; }
  .pastors-table td:nth-child(3)::before{ content:"Informations : "; font-weight:700; display:block; margin-bottom:6px; }
  .pastors-table td:nth-child(4)::before{ content:"Photo : "; font-weight:700; }

  /* Photo centrée */
  .pastors-table td:nth-child(4){
    text-align:left !important;
  }
  .pastors-table td:nth-child(4) img{
    display:block;
    margin-top:8px;
    max-width:120px;
    height:auto;
    border-radius:6px;
  }
}


  /* ARTICLES */
/* ===== Articles : tableau lisible sur mobile (mode cartes) ===== */
@media (max-width: 768px){


  /* on cache l'en-tête */
  .articles-table thead{
    display:none;
  }

@media (max-width: 767px){

  /* Forcer l'alignement à gauche de "Nb" sur mobile */
  table.articles-table td[data-label="Nb"]{
    text-align: left !important;
  }
}

  /* on transforme en blocs */
  .articles-table,
  .articles-table tbody,
  .articles-table tr,
  .articles-table td{
    display:block;
    width:100%;
  }

  .articles-table tr{
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    margin:12px 0;
    overflow:hidden;
  }

  .articles-table td{
    border:none !important;
    border-top:1px solid #eee !important;
    padding:10px 12px !important;
  }

  .articles-table td:first-child{
    border-top:none !important;
  }

  /* labels */
  .articles-table td:nth-child(1)::before{ content:"Date : "; font-weight:700; }
  .articles-table td:nth-child(2)::before{ content:"Titre : "; font-weight:700; display:block; margin-bottom:4px; }
  .articles-table td:nth-child(3)::before{ content:"Sujet : "; font-weight:700; display:block; margin-bottom:4px; }
  .articles-table td:nth-child(4)::before{ content:"Auteur : "; font-weight:700; }
  .articles-table td:nth-child(5)::before{ content:"Nb : "; font-weight:700; }
  .articles-table td:nth-child(6)::before{ content:"Action : "; font-weight:700; display:block; margin-bottom:8px; }

  /* bouton plein largeur */
  .articles-table td:nth-child(6) .btn{
    width:100%;
  }
}

@media (max-width: 768px){
  .articles-search{ width:100% !important; }
  .form-inline .form-group{ width:100%; }
  .form-inline .btn{ width:100%; margin-top:8px; }
}

/* Empêche le rognage et force le bouton à rentrer dans la cellule */
.articles-actions { white-space: normal; }
.articles-actions .btn {
  width: 100%;
  white-space: normal;
}

@media (max-width: 767px){

  /* table -> cartes */
  table.articles-table,
  table.articles-table thead,
  table.articles-table tbody,
  table.articles-table th,
  table.articles-table td,
  table.articles-table tr{
    display:block;
    width:100%;
  }

  table.articles-table thead{ display:none; }

  table.articles-table tr{
    border:1px solid #ddd;
    border-radius:10px;
    padding:0;
    margin:0 0 12px 0;
    background:#fff;
    overflow:hidden;
  }

  table.articles-table td{
    border:none !important;
    border-bottom:1px solid #eee !important;
    padding:10px 12px !important;

    /* IMPORTANT : Sujet complet */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
  }

  table.articles-table td:last-child{
    border-bottom:none !important;
  }

  /* libellé (Date, Titre, Sujet...) via data-label */
  table.articles-table td:before{
    content: attr(data-label);
    display:block;
    font-weight:700;
    color:#555;
    margin-bottom:4px;
  }

  /* bouton action */
  .articles-actions{ text-align:left !important; }
  .articles-actions .btn{ width:100%; }
}


  /* COMMENTAIRES D'ARTICLES */
@media (max-width: 767px){

  /* Transforme le tableau commentaires en cartes */
  table.comments-table thead{
    display: none;
  }
  table.comments-table,
  table.comments-table tbody,
  table.comments-table tr,
  table.comments-table td{
    display: block;
    width: 100%;
  }

  table.comments-table tr{
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fff;
  }

  table.comments-table td{
    border: none !important;
    padding: 8px 0 !important;
  }

  /* Label à gauche + valeur à droite (lisible) */
  table.comments-table td[data-label]{
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }
  table.comments-table td[data-label]::before{
    content: attr(data-label) " :";
    min-width: 110px;
    font-weight: 700;
    color: #333;
  }

  /* Action : alignée à gauche + bouton pleine largeur */
  table.comments-table td[data-label="Action"]{
    justify-content: flex-start;
  }
  table.comments-table td[data-label="Action"] .btn{
    width: 100%;
  }

  /* Contenu long : on force la coupure propre */
  table.comments-table td[data-label="Contenu"]{
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}


/* =========================================================
   PATCH Bootstrap 3 : éviter le débordement des .row
   (à placer TOUT EN BAS du fichier)
   ========================================================= */

/* Restaure le comportement attendu de Bootstrap */
.container {
  padding-left: 15px !important;
  padding-right: 15px !important;

  /* évite des effets indésirables */
  overflow: visible !important;
  justify-content: normal !important;
  align-items: normal !important;
}

/* Sécurité : empêche certains contenus de forcer la largeur */
img, iframe, video, table {
  max-width: 100%;
}

/* Si un texte très long (URL, mot) force la largeur */
* {
  overflow-wrap: anywhere;
  word-break: break-word;
}

