/* ==========================================================================
   LA MAISON DES LIVRES - Municipal Library Association of Esnandes
   Official Public Interest Platform - Association Loi 1901 (RNA W173009213)
   Responsive Stylesheet & Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --color-topbar: #E64A19;
  --color-navy: #0A4260;
  --color-navy-hover: #073046;
  --color-action-blue: #0082AD;
  --color-action-hover: #00688B;
  --color-magenta: #C2185B;
  --color-magenta-hover: #9C1045;
  --color-green: #2E7D32;
  --color-green-hover: #1B5E20;
  --color-alert-red: #D32F2F;
  --color-alert-hover: #B71C1C;
  --color-heading: #0F172A;
  --color-body: #475569;
  --color-bg-card: #FFFFFF;
  --color-bg-light: #F8FAFC;
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(10, 66, 96, 0.1), 0 8px 10px -6px rgba(10, 66, 96, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-body);
  background-color: var(--color-bg-light);
  line-height: 1.7;
  font-size: 1.05rem;
}

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

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.95rem; margin-top: 2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.45rem; margin-top: 1.5rem; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.35rem;
}

a {
  color: var(--color-action-blue);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

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

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

/* --------------------------------------------------------------------------
   Documentary Photography Standards & Captions
   -------------------------------------------------------------------------- */
.doc-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;
  transition: transform 0.3s ease;
}

.doc-img:hover {
  transform: translateY(-2px);
}

figcaption {
  font-size: 0.875rem;
  color: #64748B;
  font-style: italic;
  margin-bottom: 24px;
  display: block;
  line-height: 1.45;
  padding: 0 4px;
}

/* --------------------------------------------------------------------------
   Top Bar
   -------------------------------------------------------------------------- */
.top-bar {
  background-color: var(--color-topbar);
  color: #FFFFFF;
  font-size: 0.875rem;
  padding: 8px 0;
  font-weight: 500;
}

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

.top-bar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

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

.top-bar-contact a {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-bar-contact a:hover {
  color: #FFE0B2;
}

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

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFFFFF;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  color: var(--color-navy);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  font-family: var(--font-heading);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 500;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  color: #F1F5F9;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  min-height: 44px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link:focus, .nav-item.active .nav-link {
  background-color: var(--color-navy-hover);
  color: #FFFFFF;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1010;
  border: 1px solid var(--color-border);
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 10px 18px;
  color: var(--color-heading);
  font-size: 0.92rem;
  font-weight: 500;
  min-height: 44px;
  line-height: 24px;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-link:hover {
  background-color: var(--color-bg-light);
  color: var(--color-action-blue);
  padding-left: 22px;
}

.nav-cta {
  background-color: var(--color-action-blue);
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease;
}

.nav-cta:hover {
  background-color: var(--color-action-hover);
  color: #FFFFFF;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
}

/* --------------------------------------------------------------------------
   Layout Containers & Grid
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 0;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0A4260 0%, #0082AD 100%);
  color: #FFFFFF;
  padding: 70px 0 60px 0;
  position: relative;
  overflow: hidden;
}

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

.hero-content h1 {
  color: #FFFFFF;
  font-size: 2.85rem;
  line-height: 1.18;
  margin-bottom: 1.25rem;
}

.hero-lead-summary {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #E2E8F0;
  margin-bottom: 1.5rem;
  font-weight: 400;
  padding-left: 14px;
  border-left: 4px solid var(--color-topbar);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pill-orange {
  background-color: var(--color-topbar);
  color: #FFFFFF;
}

.badge-pill-navy {
  background-color: rgba(255,255,255,0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.3);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  min-height: 48px;
  min-width: 44px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--color-alert-red);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-alert-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
}

.btn-secondary:hover {
  background-color: #FFFFFF;
  color: var(--color-navy);
}

.btn-green {
  background-color: var(--color-green);
  color: #FFFFFF;
}

.btn-green:hover {
  background-color: var(--color-green-hover);
  color: #FFFFFF;
}

.hero-media {
  position: relative;
}

.hero-banner-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid rgba(255,255,255,0.2);
}

.hero-banner-frame img {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

/* Standalone Notre Mission Callout */
.mission-callout {
  background: linear-gradient(135deg, #0A4260 0%, #153E54 100%);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 36px 40px;
  margin: 40px 0;
  border-left: 8px solid var(--color-topbar);
  box-shadow: var(--shadow-lg);
}

.mission-callout h3 {
  color: #FFE0B2;
  font-size: 1.55rem;
  margin-top: 0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mission-callout p {
  color: #F1F5F9;
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 0;
}

/* Content Grid & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

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

.card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 28px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 18px;
}

.card-icon-blue { background-color: #E0F2FE; color: var(--color-action-blue); }
.card-icon-green { background-color: #E8F5E9; color: var(--color-green); }
.card-icon-magenta { background-color: #FCE4EC; color: var(--color-magenta); }
.card-icon-orange { background-color: #FBE9E7; color: var(--color-topbar); }

.card h3 {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 12px;
}

/* Page Banner / Hero Simple */
.page-hero {
  background: linear-gradient(135deg, #0A4260 0%, #0082AD 100%);
  color: #FFFFFF;
  padding: 55px 0 45px 0;
  margin-bottom: 40px;
}

.page-hero h1 {
  color: #FFFFFF;
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.page-hero p.lead {
  font-size: 1.15rem;
  color: #E2E8F0;
  max-width: 850px;
  margin-bottom: 0;
}

/* Content Columns & Articles */
.content-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-body h2 {
  color: var(--color-navy);
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 8px;
  margin-top: 2.2rem;
}

.content-body ul, .content-body ol {
  margin: 1rem 0 1.5rem 1.8rem;
}

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

/* Stat Box */
.stat-banner {
  background-color: var(--color-navy);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
  margin: 40px 0;
}

.stat-item .stat-num {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  color: #FFE0B2;
  line-height: 1.1;
}

.stat-item .stat-label {
  font-size: 0.88rem;
  color: #CBD5E1;
  margin-top: 6px;
  font-weight: 500;
}

/* Forms */
.form-card {
  background-color: #FFFFFF;
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

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

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-heading);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: #F8FAFC;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-action-blue);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 130, 173, 0.15);
}

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

/* AJAX Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-icon-success {
  width: 64px;
  height: 64px;
  background-color: #E8F5E9;
  color: var(--color-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 18px auto;
}

/* --------------------------------------------------------------------------
   Mandatory Legal Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #071E2C;
  color: #94A3B8;
  padding-top: 55px;
  font-size: 0.92rem;
  border-top: 4px solid var(--color-topbar);
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 1.1rem;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

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

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

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

.footer-links a {
  color: #CBD5E1;
  display: inline-block;
  min-height: 28px;
}

.footer-links a:hover {
  color: #FFFFFF;
  padding-left: 4px;
}

.footer-disclosure-block {
  background-color: #0A2638;
  border: 1px solid #143A52;
  border-radius: 8px;
  padding: 18px;
  margin: 30px 0 25px 0;
  color: #CBD5E1;
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid #143A52;
  padding: 22px 0 28px 0;
  text-align: center;
  font-size: 0.82rem;
  color: #64748B;
}

.reinvest-alert {
  background-color: #E8F5E9;
  border-left: 4px solid var(--color-green);
  padding: 14px 18px;
  border-radius: 6px;
  color: #1B5E20;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 20px 0;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .hero-media {
    order: -1;
  }
  
  .hero-banner-frame img {
    height: 280px;
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-navy);
    padding: 16px 20px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  }
  
  .nav-menu.open {
    display: flex;
  }
  
  .nav-item {
    width: 100%;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: #073046;
    margin-left: 12px;
    margin-top: 6px;
    border: none;
  }
  
  .dropdown-link {
    color: #E2E8F0;
    padding: 8px 14px;
  }
  
  .grid-3, .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .stat-banner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-content h1 {
    font-size: 2.1rem;
  }
  
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
}
