/* ==========================================================================
   SAUVEGARDE DU PATRIMOINE DE SENANTES - INSTITUTIONAL STYLESHEET
   Statutory Non-Profit & Heritage Preservation Design System
   ========================================================================== */

/* --- ROOT VARIABLES & COLOR TOKENS --- */
:root {
  --primary-purple: #4F2683;
  --dark-navy: #3A1B63;
  --text-charcoal: #1E1E24;
  --body-grey: #475569;
  --off-white: #F4F5F7;
  --pure-white: #FFFFFF;
  --border-line: #E2E8F0;
  --accent-purple-light: #F2ECF9;
  --hover-purple: #3C1C64;
  --focus-ring: rgba(79, 38, 131, 0.25);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* --- RESET & GLOBAL BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--body-grey);
  background-color: var(--pure-white);
  line-height: 1.65;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Display Headings: Serif */
h1, h2, h3, h4, .serif-heading, .stat-number, .campaign-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--text-charcoal);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: 2.75rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.15rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.45rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
}

p.lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-charcoal);
}

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

a:hover {
  color: var(--dark-navy);
}

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

/* --- CONTAINER ARCHITECTURE --- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

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

/* --- BUTTONS & CALLS TO ACTION --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  min-height: 44px;
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-purple);
  color: var(--pure-white);
  border-color: var(--primary-purple);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--primary-purple);
  border-color: var(--primary-purple);
}

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

.btn-white {
  background-color: var(--pure-white);
  color: var(--primary-purple);
  border-color: var(--pure-white);
}

.btn-white:hover {
  background-color: var(--off-white);
  color: var(--dark-navy);
}

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

.btn-outline-white:hover {
  background-color: var(--pure-white);
  color: var(--primary-purple);
}

.dual-btn-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- PILL TAGS & BADGES --- */
.pill-tag {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--accent-purple-light);
  color: var(--primary-purple);
  border-radius: 20px;
  margin-bottom: 14px;
}

.pill-tag-white {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--pure-white);
}

/* --- MANDATORY STATUTORY REINVESTMENT BAR --- */
.reinvestment-banner {
  background-color: var(--off-white);
  border-bottom: 1px solid var(--border-line);
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--body-grey);
  text-align: center;
}

.reinvestment-banner strong {
  color: var(--primary-purple);
}

/* --- STICKY HEADER --- */
.site-header {
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--pure-white);
  border-bottom: 1px solid var(--border-line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

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

.logo-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-charcoal);
}

.logo-shield {
  width: 44px;
  height: 44px;
  background-color: var(--primary-purple);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pure-white);
  flex-shrink: 0;
}

.logo-shield svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

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

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

.logo-main {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-charcoal);
  line-height: 1.2;
}

/* Navigation Matrix */
.nav-matrix {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 28px;
}

.nav-item a {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-charcoal);
  padding: 8px 0;
  position: relative;
}

.nav-item a:hover,
.nav-item.active a {
  color: var(--primary-purple);
}

.nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-purple);
}

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

.search-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-charcoal);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-btn:hover {
  background-color: var(--off-white);
  color: var(--primary-purple);
}

.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Mobile Drawer */
.mobile-nav-drawer {
  display: none;
  background-color: var(--pure-white);
  border-bottom: 1px solid var(--border-line);
  padding: 20px 24px;
}

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

.mobile-nav-list a {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-charcoal);
  display: block;
  padding: 10px 0;
}

/* --- HERO BANNER (TOP OF INDEX.PHP) --- */
.hero-section {
  position: relative;
  height: 520px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 11, 46, 0.85) 0%, rgba(26, 11, 46, 0.45) 60%, rgba(26, 11, 46, 0.2) 100%);
}

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

.hero-card {
  background-color: var(--pure-white);
  max-width: 620px;
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.hero-card h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  margin-bottom: 14px;
}

.hero-summary {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--body-grey);
  margin-bottom: 24px;
}

/* --- PAGE HERO FOR INTERNAL PAGES --- */
.page-hero {
  background-color: var(--dark-navy);
  color: var(--pure-white);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  color: var(--pure-white);
  font-size: 2.5rem;
}

.page-hero p.lead {
  color: rgba(255, 255, 255, 0.9);
  max-width: 780px;
}

/* --- STATISTICS MATRIX --- */
.stats-section {
  background-color: var(--pure-white);
  padding: 65px 0;
  border-bottom: 1px solid var(--border-line);
}

.stats-mission-block {
  max-width: 960px;
  margin: 0 auto 50px auto;
  text-align: center;
}

.stats-mission-block h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.mission-paragraph-uninterrupted {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-charcoal);
  background: var(--off-white);
  padding: 30px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-purple);
  text-align: left;
}

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

.stat-item {
  padding: 10px 32px;
  text-align: center;
}

.stat-item:not(:last-child) {
  border-right: 1px solid var(--border-line);
}

.stat-number {
  font-size: 3.5rem;
  color: var(--primary-purple);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-charcoal);
  line-height: 1.4;
}

/* --- CAMPAIGN SECTION --- */
.campaign-section {
  background-color: var(--primary-purple);
  color: var(--pure-white);
  padding: 90px 0;
}

.campaign-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.campaign-left .campaign-title {
  font-size: 5.5rem;
  line-height: 1.05;
  color: var(--pure-white);
  margin-bottom: 16px;
}

.campaign-left .campaign-sub {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.95);
}

.campaign-left p {
  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;
}

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

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

.campaign-focus-link {
  color: var(--pure-white);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-focus-item:hover {
  padding-right: 12px;
  border-top-color: var(--pure-white);
}

/* --- ACTIVITY & INITIATIVE CARDS (HORIZONTAL GRID) --- */
.activities-section {
  padding: 80px 0;
  background-color: var(--off-white);
}

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

.section-header-center h2 {
  font-size: 2.25rem;
}

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

.activity-card-horizontal {
  display: flex;
  background-color: var(--pure-white);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

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

.activity-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.activity-card-horizontal:hover .activity-card-img-wrap img {
  transform: scale(1.04);
}

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

.activity-card-content h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.activity-card-summary {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--body-grey);
  margin-bottom: 20px;
}

/* --- GENERAL ARTICLE / CONTENT SECTIONS --- */
.content-section {
  padding: 70px 0;
}

.content-section.bg-light {
  background-color: var(--off-white);
}

.content-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.content-image-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* --- TABLES FOR GOVERNANCE & REPORTS --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 30px 0;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  background-color: var(--pure-white);
}

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

.institutional-table th {
  background-color: var(--off-white);
  color: var(--text-charcoal);
  font-weight: 700;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-line);
}

.institutional-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-line);
  color: var(--body-grey);
}

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

.institutional-table tr:hover td {
  background-color: rgba(244, 245, 247, 0.6);
}

/* --- FORMS (VOLUNTEER & CONTACT) --- */
.form-container-card {
  background-color: var(--pure-white);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

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

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-charcoal);
  margin-bottom: 8px;
}

.form-label .required {
  color: #C53030;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-charcoal);
  background-color: var(--pure-white);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.form-note {
  font-size: 0.82rem;
  color: var(--body-grey);
  margin-top: 6px;
}

/* --- MODAL DIALOG (AJAX CONFIRMATION) --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background-color: var(--pure-white);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  padding: 36px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--accent-purple-light);
  color: var(--primary-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.modal-icon svg {
  width: 36px;
  height: 36px;
}

.modal-title {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 1rem;
  color: var(--body-grey);
  margin-bottom: 24px;
}

/* --- FOOTER --- */
.pre-footer-bar {
  background-color: var(--off-white);
  border-top: 1px solid var(--border-line);
  padding: 20px 0;
  font-size: 0.9rem;
  color: var(--text-charcoal);
}

.pre-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.pre-footer-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pre-footer-item svg {
  width: 18px;
  height: 18px;
  color: var(--primary-purple);
}

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

.footer-grid-4 {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-col h4 {
  color: var(--pure-white);
  font-size: 1.15rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

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

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

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

.footer-links-list a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  transition: color var(--transition-fast);
}

.footer-links-list a:hover {
  color: var(--pure-white);
  padding-left: 4px;
}

.footer-contact-info {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.footer-contact-info p {
  margin-bottom: 8px;
}

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

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

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

.sub-footer-links a:hover {
  color: var(--pure-white);
}

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

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 992px) {
  .nav-matrix {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-nav-drawer.open {
    display: block;
  }

  .hero-section {
    height: auto;
    min-height: 480px;
    padding: 60px 0;
  }

  .campaign-grid-2 {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .campaign-focus-item {
    text-align: left;
  }

  .activity-cards-grid {
    grid-template-columns: 1fr;
  }

  .content-grid-2 {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.15rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .hero-card {
    padding: 24px;
  }

  .hero-card h1 {
    font-size: 1.85rem;
  }

  .dual-btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dual-btn-row .btn {
    width: 100%;
  }

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

  .stat-item:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 30px;
  }

  .activity-card-horizontal {
    flex-direction: column;
  }

  .activity-card-img-wrap,
  .activity-card-content {
    width: 100%;
  }

  .activity-card-img-wrap {
    height: 220px;
  }

  .campaign-left .campaign-title {
    font-size: 3.5rem;
  }

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

  .pre-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
