/* ============================================================
   CA4SFC — Feuille de style principale
   Identité : terre, agriculture, patrimoine (vert olive + terracotta)
   ============================================================ */
:root {
  --primary: #3f6b1f;        /* vert olive cultures */
  --primary-dark: #2c4d13;
  --secondary: #b3541e;      /* terracotta */
  --accent: #e8b33d;         /* jaune moisson */
  --dark: #1e2a14;
  --light: #f7f6ef;
}

body { font-family: 'Nunito', sans-serif; color: #2b3325; background: #fff; }
h1,h2,h3 { font-family: 'Merriweather', serif; font-weight: 900; }
h4,h5,h6 { font-weight: 800; }
a { text-decoration: none; }

/* Topbar */
.topbar { background: var(--primary-dark); color: #e3ecd6; font-size: .85rem; padding: .35rem 0; }
.topbar a { color: #e3ecd6; }
.topbar a:hover { color: #fff; }

/* Navigation */
.main-nav { background: var(--primary); padding: .5rem 0; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.main-nav .nav-link { color: #f0f7e6 !important; font-weight: 700; padding: .5rem .75rem !important; font-size: .94rem; }
.main-nav .nav-link:hover, .main-nav .nav-link.active { color: var(--accent) !important; }
.navbar-brand { display: flex; align-items: center; gap: .55rem; color: #fff !important; }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.footer-logo { border-radius: 50%; background: #fff; padding: 2px; }
.brand-icon { background: var(--accent); color: var(--primary-dark); width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.brand-text { font-size: 1.05rem; line-height: 1.05; }
.brand-text small { font-size: .62rem; letter-spacing: .5px; opacity: .85; }
.navbar-toggler { border-color: rgba(255,255,255,.5); }
.navbar-toggler-icon { filter: invert(1); }
.btn-involve { background: var(--secondary); color: #fff !important; font-weight: 700; border-radius: 20px; }
.btn-involve:hover { background: #93451a; }
.mobile-menu li a { display: block; padding: .55rem 0; color: #2b3325; font-weight: 600; border-bottom: 1px solid #eee; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #557f2d 100%); color: #fff; padding: 5rem 0 4rem; position: relative; overflow: hidden; }
.hero h1 { font-size: 2rem; line-height: 1.35; }
.hero .lead { color: #e3ecd6; }
.hero .slogan { color: var(--accent); font-style: italic; font-weight: 700; }
.btn-cta { background: var(--secondary); border: none; color: #fff; font-weight: 700; padding: .7rem 1.6rem; border-radius: 30px; }
.btn-cta:hover { background: #93451a; color:#fff; }
.btn-outline-cta { border: 2px solid #fff; color: #fff; font-weight: 700; padding: .6rem 1.5rem; border-radius: 30px; }
.btn-outline-cta:hover { background: #fff; color: var(--primary); }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--light); }
.section-title { color: var(--primary-dark); margin-bottom: .4rem; }
.section-sub { color: #6b7461; max-width: 760px; white-space: pre-line; }
.card-feature { border: none; border-radius: 14px; box-shadow: 0 4px 18px rgba(63,107,31,.09); transition: .25s; height: 100%; }
.card-feature:hover { transform: translateY(-5px); box-shadow: 0 10px 26px rgba(63,107,31,.17); }
.project-card-link { display: block; color: inherit; height: 100%; }
.project-card-link:hover { color: inherit; }
.project-cover { width: 100%; height: 210px; object-fit: cover; border-radius: 14px 14px 0 0; }
.project-card { overflow: hidden; }
.project-content { line-height: 1.8; overflow-wrap: anywhere; }
.project-content a { color: var(--primary-dark); text-decoration: underline; }
.news-card-link { display: block; height: 100%; color: inherit; text-decoration: none; border-radius: 16px; }
.news-card-link:hover, .news-card-link:focus { color: inherit; }
.news-card-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.news-card { display: flex; height: 540px; max-height: 540px; flex-direction: column; overflow: hidden; border: 1px solid rgba(44,77,19,.08); border-radius: 16px; background: #fff; box-shadow: 0 5px 20px rgba(34,48,24,.08); transition: transform .25s ease, box-shadow .25s ease; }
.news-card-link:hover .news-card, .news-card-link:focus-visible .news-card { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(34,48,24,.16); }
.news-card-media { position: relative; flex: 0 0 220px; height: 220px; max-height: 220px; overflow: hidden; background: #e9eddf; }
.news-card-cover { display: block; width: 100%; height: 220px; max-height: 220px; object-fit: cover; object-position: center; transition: transform .4s ease; }
.news-card-link:hover .news-card-cover, .news-card-link:focus-visible .news-card-cover { transform: scale(1.035); }
.news-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .65rem; min-height: 1.9rem; margin-bottom: .9rem; }
.news-card-type { display: inline-flex; flex-shrink: 0; align-items: center; padding: .35rem .7rem; border-radius: 999px; background: #eef3e7; color: var(--primary-dark); font-size: .72rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.news-card-type-event { background: var(--primary); color: #fff; }
.news-card .card-body { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; padding: 1.35rem 1.4rem 1.2rem; }
.news-card-date { color: #67715e; font-size: .75rem; font-weight: 700; text-align: right; }
.news-card-title { display: -webkit-box; min-height: 4.65em; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; margin: 0 0 .65rem; color: #26351c; font-family: 'Merriweather', Georgia, serif; font-size: clamp(1rem, 1.2vw, 1.08rem); font-weight: 700; line-height: 1.55; }
.news-card-summary { display: -webkit-box; min-height: 4.95em; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; margin-bottom: 1rem; color: #687064 !important; font-size: .91rem !important; line-height: 1.65; }
.news-card-cta { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: .85rem; border-top: 1px solid #edf0e8; color: var(--primary-dark); font-size: .88rem; font-weight: 800; }
.news-card-cta span { display: inline-flex; width: 1.8rem; height: 1.8rem; align-items: center; justify-content: center; border-radius: 50%; background: #eef3e7; font-size: 1.1rem; transition: transform .2s ease, background .2s ease; }
.news-card-link:hover .news-card-cta span, .news-card-link:focus-visible .news-card-cta span { transform: translateX(3px); background: #e1ebd5; }
.detail-hero { position: relative; display: flex; min-height: 360px; align-items: stretch; overflow: hidden; background: var(--primary-dark); }
.detail-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero-overlay { position: relative; z-index: 1; display: flex; width: 100%; align-items: end; padding: 3rem 0 2rem; background: linear-gradient(90deg, rgba(20,35,12,.78), rgba(20,35,12,.2)), linear-gradient(0deg, rgba(20,35,12,.55), transparent 75%); color: #fff; }
.detail-hero h1 { text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.detail-hero .breadcrumb { --bs-breadcrumb-divider-color: rgba(255,255,255,.7); }
.detail-hero .breadcrumb-item, .detail-hero .breadcrumb-item.active { color: rgba(255,255,255,.85); }
.detail-hero .breadcrumb-item a { color: #fff; }
.news-content { line-height: 1.8; overflow-wrap: anywhere; }
.news-content a { color: var(--primary-dark); text-decoration: underline; }
.project-content img, .news-content img { display: block; max-width: 100%; height: auto; margin: 1.25rem auto; border-radius: 10px; }
.project-content img.content-image-left, .news-content img.content-image-left { float: left; width: 50%; margin: .4rem 1.25rem 1rem 0; }
.project-content img.content-image-right, .news-content img.content-image-right { float: right; width: 50%; margin: .4rem 0 1rem 1.25rem; }
.project-content img.content-image-center, .news-content img.content-image-center { float: none; margin: 1.25rem auto; }
.project-content img.content-image-25, .news-content img.content-image-25 { width: 25%; }
.project-content img.content-image-50, .news-content img.content-image-50 { width: 50%; }
.project-content img.content-image-75, .news-content img.content-image-75 { width: 75%; }
.project-content img.content-image-100, .news-content img.content-image-100 { width: 100%; }
.project-content::after, .news-content::after { content: ""; display: table; clear: both; }
.project-content h2, .news-content h2 { margin-top: 2rem; }
.project-content h3, .news-content h3, .project-content h4, .news-content h4 { margin-top: 1.5rem; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .5rem; border: 1px solid #ced4da; border-bottom: 0; border-radius: .375rem .375rem 0 0; background: #f8f9fa; }
.rich-editor-block { width: auto; max-width: 150px; }
.rich-editor-area { min-height: 300px; padding: .75rem; border: 1px solid #ced4da; border-radius: 0 0 .375rem .375rem; background: #fff; overflow-wrap: anywhere; }
.rich-editor-area:focus { outline: 0; border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }
.rich-editor-area img { display: block; max-width: 100%; height: auto; margin: .75rem 0; }
.feature-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(63,107,31,.1); color: var(--primary); display:flex; align-items:center; justify-content:center; font-size: 1.6rem; margin-bottom: 1rem; }
.feature-icon.alt { background: rgba(179,84,30,.12); color: var(--secondary); }

/* Cartes cultures & recettes */
.crop-card img, .crop-card .img-placeholder { height: 200px; object-fit: cover; width: 100%; border-radius: 14px 14px 0 0; }
.img-placeholder { background: linear-gradient(135deg,#eef3e2,#dce8c8); display:flex; align-items:center; justify-content:center; color: var(--primary); font-size: 2.6rem; }
.badge-crop { background: rgba(63,107,31,.12); color: var(--primary-dark); font-weight: 700; border-radius: 20px; padding: .3rem .7rem; font-size: .75rem; }
.badge-terra { background: rgba(179,84,30,.12); color: var(--secondary); font-weight: 700; border-radius: 20px; padding: .3rem .7rem; font-size: .75rem; }

/* Page header interne */
.page-head { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); color:#fff; padding: 3rem 0 2.2rem; }
.page-head h1 { font-size: 1.7rem; }
.breadcrumb-item a { color: var(--accent); }
.breadcrumb-item.active { color: #e3ecd6; }

/* Valeurs / organes */
.value-card { border-left: 5px solid var(--accent); background:#fff; border-radius: 10px; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.organ-card { border-top: 4px solid var(--primary); background:#fff; border-radius: 12px; box-shadow: 0 3px 12px rgba(0,0,0,.06); }

/* Footer */
.site-footer { background: var(--dark); color: #c2cbb4; padding: 3.5rem 0 1.5rem; }
.site-footer h5, .site-footer h6 { color: #fff; }
.site-footer a { color: #c2cbb4; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .45rem; font-size: .92rem; }
.site-footer hr { border-color: #38452b; }

/* Chatbot */
#ca4sfc-chatbot { position: fixed; bottom: 22px; right: 22px; z-index: 1050; }
#chatbot-toggle { width: 60px; height: 60px; border-radius: 50%; border: none; background: var(--secondary); color: #fff; font-size: 1.6rem; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#chatbot-toggle:hover { background: #93451a; }
#chatbot-window { position: fixed; bottom: 95px; right: 22px; width: 360px; max-width: calc(100vw - 30px); height: 480px; background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; }
.chatbot-header { background: var(--primary); color: #fff; padding: .9rem 1rem; display: flex; justify-content: space-between; align-items: center; }
#chatbot-messages { flex: 1; overflow-y: auto; padding: 1rem; background: #f8f7f0; display: flex; flex-direction: column; gap: .6rem; }
.bot-msg, .user-msg { max-width: 85%; padding: .6rem .85rem; border-radius: 14px; font-size: .9rem; line-height: 1.45; white-space: pre-wrap; }
.bot-msg { background: #fff; border: 1px solid #e3e8d5; align-self: flex-start; border-bottom-left-radius: 4px; }
.user-msg { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bot-typing { font-style: italic; color: #8b9479; font-size: .85rem; align-self: flex-start; }
.chatbot-disclaimer { font-size: .72rem; color: #6b7461; background: #fff8e6; border-top: 1px solid #f0e3b8; padding: .35rem .8rem; line-height: 1.3; }
#chatbot-form { display: flex; border-top: 1px solid #e8ece0; }
#chatbot-input { flex: 1; border: none; padding: .85rem 1rem; outline: none; font-size: .92rem; }
#chatbot-form button { border: none; background: var(--secondary); color: #fff; width: 54px; }

/* Formulaires */
.form-card { background:#fff; border-radius: 14px; box-shadow: 0 5px 22px rgba(0,0,0,.08); padding: 2rem; }
.required::after { content: " *"; color: #b3541e; }
.involve-hero { padding: 3.5rem 0 3rem; background: radial-gradient(ellipse at 85% 15%, rgba(232,179,61,.2), transparent 35%), linear-gradient(120deg, var(--primary-dark), var(--primary)); }
.involve-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.involve-hero-lead { max-width: 760px; margin: 1.4rem 0 1.6rem; color: #edf3e6; font-size: 1.1rem; line-height: 1.7; }
.involve-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.involve-hero-actions .btn { padding: .7rem 1.15rem; border-radius: 999px; font-weight: 800; }
.involve-hero-actions .btn-outline-light:hover { color: var(--primary-dark); }
.involvement-tabs { justify-content: center; gap: .65rem; margin-bottom: 2rem; }
.involvement-tabs .nav-link { display: inline-flex; align-items: center; padding: .8rem 1.2rem; border: 1px solid #dfe7d7; border-radius: 999px; background: #fff; color: var(--primary-dark); font-weight: 800; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.involvement-tabs .nav-link:hover { background: #eef3e7; }
.involvement-tabs .nav-link.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 5px 14px rgba(63,107,31,.2); }
.involvement-tab-content { max-width: 900px; margin: 0 auto; }
.involvement-form-card { padding: clamp(1.35rem, 4vw, 2.5rem); border: 1px solid rgba(44,77,19,.08); }
.involvement-form-card h5 { margin-bottom: .65rem; color: var(--primary-dark); font-family: 'Merriweather', Georgia, serif; font-size: 1.35rem; }
.involvement-form-card > p.small.text-muted { margin-bottom: 1.5rem; line-height: 1.65; }
.involvement-form-card .form-control, .involvement-form-card .form-select { padding: .7rem .85rem; border-color: #dce3d5; border-radius: 9px; }
.involvement-form-card .form-control:focus, .involvement-form-card .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(63,107,31,.14); }
.involvement-form-card .btn-cta { min-height: 44px; margin-top: .35rem; }
@media (max-width: 576px) {
  .involve-hero { padding: 2.5rem 0; }
  .involve-hero-actions { flex-direction: column; align-items: stretch; }
  .involvement-tabs { display: grid; grid-template-columns: 1fr; }
  .involvement-tabs .nav-link { justify-content: center; }
}

/* Divers */
.stat-box { background:#fff; border-radius: 14px; padding: 1.4rem; text-align:center; box-shadow: 0 3px 14px rgba(0,0,0,.06); }
.stat-box .num { font-size: 1.9rem; font-weight: 800; color: var(--secondary); }
.cta-band { background: linear-gradient(120deg, var(--secondary), #cf6a2c); color:#fff; padding: 3rem 0; }
.team-photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--light); }
.team-placeholder { width: 110px; height: 110px; border-radius: 50%; background: #eef3e2; display:flex; align-items:center; justify-content:center; color: var(--primary); font-size: 2.2rem; margin: 0 auto; }
.team-member-card { border: 0; color: inherit; font: inherit; cursor: pointer; }
.team-member-card:hover, .team-member-card:focus-visible { color: inherit; }
@media (max-width: 576px) {
  .hero h1 { font-size: 1.45rem; }
  .hero { padding: 3rem 0; }
  .detail-hero { min-height: 280px; }
  .detail-hero-overlay { padding: 2rem 0 1.5rem; }
  .news-card .card-body { padding: 1.15rem; }
  .news-card-title { font-size: 1rem; }
  .news-card-meta { align-items: flex-start; }
  .news-card-date { max-width: 60%; }
}

.legal-note { font-size: .8rem; color: #5b6451; background: var(--light); border-radius: 10px; padding: .8rem 1rem; }
.legal-note summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); }
.empty-state { background: var(--light); border: 2px dashed #c9d7b0; border-radius: 14px; padding: 2.2rem 1.5rem; text-align: center; }
.empty-state .svg-i { font-size: 2.4rem; color: var(--primary); }

/* Icônes SVG inline */
.svg-i { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; flex-shrink: 0; }
