/* ==========================================================================
   PATRIMOINE RURAL DU BESSIN - OFFICIAL PORTAL STYLESHEET
   Salado Design System: #1B2232 (Deep Navy), #FF5B2E (Coral), #F8F9FA (Off-White)
   Compliant with Loi 1901 French Association Standards & Mobile Accessibility
   ========================================================================== */

:root {
  --color-navy: #1B2232;
  --color-navy-dark: #121722;
  --color-navy-light: #263147;
  --color-coral: #FF5B2E;
  --color-coral-hover: #E0481D;
  --color-coral-subtle: #FFF0EB;
  --color-bg-light: #F8F9FA;
  --color-bg-white: #FFFFFF;
  --color-border: #E2E8F0;
  --color-text-main: #2D3748;
  --color-text-muted: #64748B;
  --color-text-light: #94A3B8;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 15px rgba(27,34,50,0.08);
  --shadow-lg: 0 10px 25px rgba(27,34,50,0.12);
  --transition: all 0.25s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--color-coral);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-coral-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 900px;
}

/* --- Top Utility Bar --- */
.top-bar {
  background-color: var(--color-navy-dark);
  color: #CBD5E1;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.top-bar-badges {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge-official {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge-official span {
  color: #38BDF8;
}

.top-bar-links a {
  color: #E2E8F0;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-bar-links a:hover {
  color: var(--color-coral);
}

/* --- Main Header & Navigation --- */
.main-header {
  background-color: var(--color-navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-name {
  color: #FFFFFF;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-subtitle {
  color: #94A3B8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 8px;
}

.nav-link {
  color: #E2E8F0;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  line-height: 24px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-link.active {
  border-bottom: 2px solid var(--color-coral);
}

.nav-cta-btn {
  background-color: var(--color-coral);
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(255, 91, 46, 0.35);
}

.nav-cta-btn:hover {
  background-color: var(--color-coral-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #FFFFFF;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 10px 12px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

/* --- Hero Banner --- */
.hero-section {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #FFFFFF;
  padding: 64px 0 72px 0;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 91, 46, 0.2);
  color: #FF8F6B;
  border: 1px solid rgba(255, 91, 46, 0.4);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.8px;
}

.hero-summary-block {
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--color-coral);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #F1F5F9;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 2px solid transparent;
  min-height: 48px;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--color-coral);
  color: #FFFFFF !important;
}

.btn-primary:hover {
  background-color: var(--color-coral-hover);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 91, 46, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
  text-decoration: none;
}

.btn-outline-navy {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.btn-outline-navy:hover {
  background: var(--color-navy);
  color: #FFFFFF !important;
  text-decoration: none;
}

.hero-image-wrap {
  position: relative;
}

.hero-image-wrap img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: var(--shadow-lg);
}

.hero-image-wrap figcaption {
  font-size: 0.85rem;
  color: #CBD5E1;
  font-style: italic;
  margin-top: 10px;
  text-align: center;
}

/* Page Banner (Subpages) */
.page-banner {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #FFFFFF;
  padding: 48px 0 54px 0;
}

.page-banner-title {
  font-size: 2.35rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.page-banner-sub {
  font-size: 1.15rem;
  color: #CBD5E1;
  max-width: 800px;
}

/* --- Section Layouts --- */
.section {
  padding: 60px 0;
}

.section-alt {
  background-color: #FFFFFF;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 44px auto;
}

.section-tag {
  color: var(--color-coral);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.1rem;
  color: var(--color-navy);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

/* --- Dedicated Mission Box (EXACTLY 120+ Words) --- */
.mandatory-mission-box {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-left: 6px solid var(--color-coral);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin: 36px 0;
  box-shadow: var(--shadow-sm);
}

.mandatory-mission-box h3 {
  font-size: 1.45rem;
  color: var(--color-navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mandatory-mission-box p {
  font-size: 1.05rem;
  color: var(--color-text-main);
  line-height: 1.8;
}

/* --- Funding Disclosure Highlight --- */
.funding-disclosure-banner {
  background-color: var(--color-coral-subtle);
  border: 1px solid #FFCCA8;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin: 28px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #9C2E10;
  font-weight: 600;
  font-size: 1.02rem;
}

.funding-disclosure-banner svg {
  flex-shrink: 0;
}

/* --- Grid Systems --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* --- Cards --- */
.card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-coral-subtle);
  color: var(--color-coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 800;
}

.card-title {
  font-size: 1.25rem;
  color: var(--color-navy);
  font-weight: 700;
  margin-bottom: 12px;
}

.card-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* --- Real Documentary Photography Styles --- */
.documentary-photo-wrap {
  margin: 28px 0 12px 0;
}

.documentary-photo-wrap img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin: 20px 0 8px 0;
  object-fit: cover;
}

.documentary-photo-wrap figcaption {
  font-size: 0.875rem;
  color: #64748B;
  margin-bottom: 20px;
  font-style: italic;
  line-height: 1.4;
  padding-left: 4px;
}

/* Image with fixed aspect ratios */
.photo-h280 img {
  height: 280px;
}

.photo-h340 img {
  height: 340px;
}

.photo-h400 img {
  height: 400px;
}

/* --- Stats Bar --- */
.stats-strip {
  background-color: var(--color-navy);
  color: #FFFFFF;
  padding: 44px 0;
  border-radius: var(--radius-xl);
  margin: 40px 0;
  box-shadow: var(--shadow-md);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item {
  padding: 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
  border-right: none;
}

.stat-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--color-coral);
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.95rem;
  color: #CBD5E1;
  font-weight: 500;
}

/* --- Status Badges --- */
.status-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #DCFCE7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge-active::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #16A34A;
}

/* --- Financial & Progress Bars --- */
.progress-bar-group {
  margin: 18px 0;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-navy);
}

.progress-track {
  background-color: #E2E8F0;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  background-color: var(--color-coral);
  height: 100%;
  border-radius: 6px;
}

/* --- Tables for Financial Transparency --- */
.table-responsive {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #FFFFFF;
  text-align: left;
}

.data-table th {
  background-color: var(--color-navy);
  color: #FFFFFF;
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-size: 0.95rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: #F8FAFC;
}

/* --- Forms & Intake Modules --- */
.form-box {
  background-color: #FFFFFF;
  padding: 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text-main);
  transition: var(--transition);
  background-color: #FFFFFF;
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-coral);
  box-shadow: 0 0 0 3px rgba(255, 91, 46, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- Inline CTA Banners (5 Distributed on Home & Pages) --- */
.inline-cta-banner {
  background: linear-gradient(135deg, #1B2232 0%, #263147 100%);
  color: #FFFFFF;
  padding: 36px;
  border-radius: var(--radius-lg);
  margin: 48px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.inline-cta-text h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.inline-cta-text p {
  color: #CBD5E1;
  font-size: 0.98rem;
  max-width: 600px;
}

/* --- Interactive Modal Popup (Clean AJAX Response) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 23, 34, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 36px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  position: relative;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 64px;
  height: 64px;
  background-color: #DCFCE7;
  color: #16A34A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px auto;
  font-weight: 800;
}

.modal-title {
  font-size: 1.5rem;
  color: var(--color-navy);
  font-weight: 800;
  margin-bottom: 12px;
}

.modal-desc {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-navy);
  color: #94A3B8;
  padding-top: 60px;
  margin-top: auto;
  border-top: 3px solid var(--color-coral);
}

.footer-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: var(--color-coral);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #CBD5E1;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Mandatory Non-Profit Footer Disclosure */
.footer-mandatory-disclosure {
  background-color: var(--color-navy-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 36px;
  color: #CBD5E1;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-mandatory-disclosure strong {
  color: #FFFFFF;
}

.footer-bottom-bar {
  background-color: var(--color-navy-dark);
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  color: #94A3B8;
  text-align: center;
}

.footer-bottom-bar a {
  color: #CBD5E1;
}

/* --- Media Queries (Mobile & Tablet Responsiveness) --- */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-main-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .stat-item:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-navy);
    flex-direction: column;
    padding: 20px 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
    gap: 12px;
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
  }

  .nav-cta-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  .footer-main-grid {
    grid-template-columns: 1fr;
  }

  .inline-cta-banner {
    flex-direction: column;
    text-align: center;
  }

  .inline-cta-text p {
    max-width: 100%;
  }

  .top-bar-badges {
    justify-content: center;
    width: 100%;
  }

  .top-bar-links {
    width: 100%;
    text-align: center;
  }
}
