/* ==========================================================================
   DH LA DEMEURE HISTORIQUE - Institutional Non-Profit Stylesheet
   Statutory Non-Profit Association (Loi 1901) - RNA W751003815
   Visual Architecture: Fluid Grid, Flexbox, Accessible, Mobile-First
   ========================================================================== */

:root {
  --primary: #4F2683;
  --primary-hover: #3e1e67;
  --navy: #3A1B63;
  --navy-dark: #2a1347;
  --charcoal: #1E1E24;
  --grey: #475569;
  --grey-light: #64748B;
  --offwhite: #F4F5F7;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;
  --accent-gold: #C59B27;
  --success: #166534;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, Cambria, "Times New Roman", serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(58, 27, 99, 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-body);
  font-size: 1rem;
  line-height: 1.68;
  color: var(--grey);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  color: var(--charcoal);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.75rem; letter-spacing: -0.02em; }
h2 { font-size: 2.15rem; letter-spacing: -0.01em; margin-bottom: 1.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1.25rem;
  max-width: 75ch;
}

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

a:hover {
  color: var(--primary-hover);
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ==========================================================================
   BUTTONS & CTAs (Strict Rule: Max 2 CTAs inline, min 44px touch target)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white) !important;
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background-color: rgba(79, 38, 131, 0.08);
  color: var(--primary-hover) !important;
}

.btn-secondary-white {
  background-color: transparent;
  color: var(--white) !important;
  border: 2px solid var(--white);
}

.btn-secondary-white:hover {
  background-color: var(--white);
  color: var(--primary) !important;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ==========================================================================
   HEADER & STICKY NAVIGATION (80px height)
   ========================================================================== */

.site-header {
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-height: 44px;
}

.shield-icon {
  width: 38px;
  height: 44px;
  color: var(--primary);
  flex-shrink: 0;
}

.logo-text-block {
  display: flex;
  flex-direction: column;
}

.logo-brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.logo-sub-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--grey);
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  padding: 10px 4px;
  min-height: 44px;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 1010;
}

.nav-item:hover .nav-dropdown {
  display: flex;
}

.dropdown-link {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  display: block;
  min-height: 44px;
  line-height: 24px;
}

.dropdown-link:hover {
  background-color: var(--offwhite);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-search-btn {
  background: none;
  border: none;
  color: var(--grey);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  transition: var(--transition);
}

.header-search-btn:hover {
  color: var(--primary);
  background-color: var(--offwhite);
}

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  color: var(--charcoal);
  cursor: pointer;
}

/* ==========================================================================
   STATUTORY BANNER & CLAUSES
   ========================================================================== */

.statutory-tag {
  display: inline-block;
  background-color: rgba(79, 38, 131, 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.statutory-notice-box {
  background: var(--offwhite);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  margin: 1.75rem 0;
  border-radius: 0 4px 4px 0;
}

.statutory-notice-box p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--charcoal);
  font-weight: 600;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 540px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(26, 11, 46, 0.85) 0%, rgba(58, 27, 99, 0.6) 60%, rgba(26, 11, 46, 0.4) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-card {
  background: var(--white);
  padding: 40px;
  border-radius: 6px;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.hero-card h1 {
  font-size: 2.35rem;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-summary {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--grey);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   STATISTICS MATRIX (3-Column Grid)
   ========================================================================== */

.stats-matrix-section {
  background: var(--white);
  padding: 70px 0;
  border-bottom: 1px solid var(--border);
}

.section-head-center {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3rem auto;
}

.mission-highlight-block {
  background-color: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  margin: 1.5rem auto 2.5rem auto;
  text-align: justify;
}

.mission-highlight-block h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mission-highlight-block p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--charcoal);
  margin: 0;
}

.stats-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-col {
  padding: 36px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}

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

.stat-number {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.stat-desc {
  font-size: 0.88rem;
  color: var(--grey);
  margin: 0 auto;
  max-width: 28ch;
}

/* ==========================================================================
   CAMPAIGN SECTION ("All in.")
   ========================================================================== */

.campaign-section {
  background: var(--primary);
  color: var(--white);
  padding: 90px 0;
}

.campaign-grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.campaign-title-giant {
  font-family: var(--font-heading);
  font-size: 5.5rem;
  font-weight: 700;
  line-height: 0.95;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.campaign-subtitle {
  font-size: 1.35rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1rem;
}

.campaign-body {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  line-height: 1.7;
}

.campaign-focus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.campaign-focus-item {
  border-top: 2px solid rgba(255, 255, 255, 0.85);
  padding: 20px 0;
  text-align: right;
  transition: var(--transition);
}

.campaign-focus-item:last-child {
  border-bottom: 2px solid rgba(255, 255, 255, 0.85);
}

.campaign-focus-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  display: block;
}

.campaign-focus-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
}

/* ==========================================================================
   HORIZONTAL ACTIVITY CARDS GRID
   ========================================================================== */

.activities-section {
  padding: 80px 0;
  background: var(--offwhite);
}

.activities-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.activity-card-horizontal {
  display: flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.activity-card-horizontal:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.activity-img-col {
  width: 40%;
  position: relative;
  overflow: hidden;
}

.activity-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-content-col {
  width: 60%;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.activity-content-col h3 {
  font-size: 1.28rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.activity-summary-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--grey);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   INSTITUTIONAL CONTENT PAGES & ARTICLES
   ========================================================================== */

.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  color: var(--white);
  font-size: 2.75rem;
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.15rem;
  max-width: 75ch;
  margin: 0;
}

.page-content-section {
  padding: 70px 0;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.78;
}

.article-content h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  margin-top: 1.75rem;
}

.article-content ul, .article-content ol {
  margin: 1.25rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.content-grid-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}

.sidebar-widget {
  background: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-widget h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 6px;
}

/* ==========================================================================
   DATA TABLES & DIRECTORIES
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.data-table th {
  background-color: var(--offwhite);
  color: var(--charcoal);
  font-weight: 700;
}

.data-table tr:nth-child(even) {
  background-color: #fafbfc;
}

.data-table tr:hover {
  background-color: rgba(79, 38, 131, 0.04);
}

/* ==========================================================================
   FORMS & MODALS (AJAX with Thank You Popup)
   ========================================================================== */

.form-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--charcoal);
  background-color: var(--white);
  min-height: 44px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 38, 131, 0.15);
}

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

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--grey);
  cursor: pointer;
}

.form-checkbox-label input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 30, 36, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--white);
  border-radius: 6px;
  padding: 36px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--grey);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-check {
  width: 64px;
  height: 64px;
  color: var(--success);
  margin: 0 auto 1rem auto;
}

/* ==========================================================================
   FOOTER (Pre-Footer Utility Bar + Main Institutional Footer + Sub-Footer)
   ========================================================================== */

.pre-footer-bar {
  background: var(--offwhite);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.pre-footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--charcoal);
}

.pre-footer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.main-footer {
  background: var(--navy);
  color: var(--white);
  padding: 70px 0 40px 0;
}

.footer-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.footer-disclosure-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.25rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  display: inline-block;
  padding: 6px 0;
  min-height: 36px;
  line-height: 24px;
}

.footer-nav-link:hover {
  color: var(--white);
  text-decoration: underline;
}

.sub-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 28px;
  text-align: center;
}

.sub-footer-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.sub-footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sub-footer-legal-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

.sub-footer-legal-links a:hover {
  color: var(--white);
  text-decoration: underline;
}

.copyright-line {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile-First Architecture)
   ========================================================================== */

@media (max-width: 992px) {
  .activities-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .campaign-grid-2 {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  
  .campaign-title-giant {
    font-size: 4rem;
  }
  
  .campaign-focus-item {
    text-align: left;
  }
  
  .footer-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .content-grid-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.15rem; }
  h2 { font-size: 1.75rem; }
  
  .site-header {
    height: 70px;
  }
  
  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    box-shadow: var(--shadow-lg);
    gap: 16px;
    align-items: flex-start;
  }
  
  .main-nav.active {
    display: flex;
  }
  
  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-link {
    width: 100%;
    padding: 12px 0;
  }
  
  .nav-dropdown {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    background-color: var(--offwhite);
  }
  
  .header-actions {
    display: none;
  }
  
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .stat-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .stat-col:last-child {
    border-bottom: none;
  }
  
  .activity-card-horizontal {
    flex-direction: column;
  }
  
  .activity-img-col {
    width: 100%;
    height: 200px;
  }
  
  .activity-content-col {
    width: 100%;
  }
  
  .footer-grid-4 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .pre-footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    width: 100%;
  }
}
