/* ============================================================
   CRDS THEME — Centre de Recherche et de Documentation du Sénégal
   Design inspiré de NUMIFAN (archives.ifan.sn) — Bootstrap 5
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
  --crds-blue:       #1e3a7b;
  --crds-blue-dark:  #152d60;
  --crds-blue-light: #2d52a0;
  --crds-cyan:       #1a9fd4;
  --crds-cyan-light: #56bce8;
  --crds-gold:       #c9a84c;
  --crds-orange:     #e86b1f;
  --crds-white:      #ffffff;
  --crds-gray:       #f5f7fa;
  --crds-gray-mid:   #e9ecef;
  --crds-text:       #2c3e50;
  --crds-muted:      #6c757d;
  --crds-border:     #dee2e6;
  --crds-shadow-sm:  0 2px 8px rgba(30,58,123,0.08);
  --crds-shadow:     0 4px 20px rgba(30,58,123,0.14);
  --crds-shadow-lg:  0 8px 40px rgba(30,58,123,0.20);
  --crds-radius:     12px;
  --crds-radius-sm:  8px;
  --crds-transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ===== BASE ===== */
body {
  font-family: 'Open Sans', sans-serif;
  color: var(--crds-text);
  background: #fff;
  line-height: 1.7;
}
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  color: var(--crds-blue);
  line-height: 1.3;
}
a { color: var(--crds-cyan); transition: color 0.2s; }
a:hover { color: var(--crds-blue); }
img { max-width: 100%; }

/* ===== NAVBAR ===== */
#top-bar {
  background: #ffffff !important;
  box-shadow: 0 2px 12px rgba(30,58,123,0.10) !important;
  border-bottom: 2px solid var(--crds-cyan) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  min-height: 80px;
}
#top-bar .container-fluid { min-height: 80px; }
#top-bar .navbar-brand { padding: 0.4rem 0; }
#top-bar .navbar-brand img { height: 55px; width: auto; }
#top-bar .navbar-brand span {
  color: var(--crds-blue) !important;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 240px;
  line-height: 1.2;
}

/* Nav links */
#top-bar .nav-link,
#top-bar .dropdown-toggle {
  color: var(--crds-blue) !important;
  font-weight: 600;
  font-size: 0.87rem;
  letter-spacing: 0.2px;
  padding: 1.4rem 0.85rem !important;
}
#top-bar .nav-link:hover,
#top-bar .dropdown-toggle:hover {
  color: var(--crds-cyan) !important;
}

/* Browse menu & secondary buttons */
#top-bar .atom-btn-secondary,
#top-bar .btn.atom-btn-secondary {
  background: var(--crds-blue) !important;
  border-color: var(--crds-blue) !important;
  color: white !important;
  border-radius: 20px !important;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.38rem 1rem !important;
  border: 1px solid var(--crds-blue) !important;
}
#top-bar .atom-btn-secondary:hover {
  background: var(--crds-cyan) !important;
  border-color: var(--crds-cyan) !important;
}

/* Navbar toggler */
#top-bar .navbar-toggler {
  border: 1.5px solid var(--crds-blue) !important;
  border-radius: 6px !important;
  background: none !important;
  padding: 0.4rem 0.6rem;
}
#top-bar .navbar-toggler .fa-bars { color: var(--crds-blue); }

/* Search box in navbar */
#search-box .form-control {
  border-radius: 22px 0 0 22px;
  border: 1.5px solid var(--crds-border);
  background: var(--crds-gray);
  color: var(--crds-text);
  font-size: 0.84rem;
}
#search-box .form-control:focus {
  background: #fff;
  border-color: var(--crds-cyan);
  box-shadow: 0 0 0 3px rgba(26,159,212,0.15);
}
#search-box .btn { border-radius: 0 22px 22px 0 !important; }

/* Dropdown menus */
#top-bar .dropdown-menu {
  border: none !important;
  border-top: 3px solid var(--crds-cyan) !important;
  box-shadow: var(--crds-shadow-lg) !important;
  border-radius: 0 0 var(--crds-radius) var(--crds-radius) !important;
  margin-top: 0 !important;
}
#top-bar .dropdown-item {
  color: var(--crds-text);
  font-size: 0.87rem;
  padding: 0.5rem 1.2rem;
  transition: var(--crds-transition);
}
#top-bar .dropdown-item:hover {
  background: var(--crds-gray);
  color: var(--crds-blue);
  padding-left: 1.5rem;
}

/* ===== HERO SECTION ===== */
.crds-hero {
  background: linear-gradient(135deg, var(--crds-blue) 0%, var(--crds-blue-light) 60%, var(--crds-cyan) 100%);
  color: white;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.crds-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.crds-hero-content { position: relative; z-index: 1; }

.crds-hero h1 {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.crds-hero h1 span { color: var(--crds-gold); }
.crds-hero .lead {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 580px;
}

.crds-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

/* Hero search */
.crds-hero-search { max-width: 560px; margin-bottom: 2.5rem; }
.crds-hero-search .form-control {
  border-radius: 30px 0 0 30px !important;
  border: none !important;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  height: 52px;
  box-shadow: none !important;
}
.crds-hero-search .btn-hero-search {
  background: var(--crds-gold);
  border: none;
  color: white;
  border-radius: 0 30px 30px 0 !important;
  padding: 0 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  height: 52px;
  transition: background 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.crds-hero-search .btn-hero-search:hover { background: var(--crds-orange); }

/* Hero action buttons */
.crds-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.btn-hero-primary {
  background: white;
  color: var(--crds-blue);
  border: none;
  border-radius: 30px;
  padding: 0.75rem 1.8rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: var(--crds-transition);
}
.btn-hero-primary:hover {
  background: var(--crds-cyan);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.btn-hero-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 30px;
  padding: 0.7rem 1.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--crds-transition);
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: white;
  transform: translateY(-2px);
}

/* Hero stats */
.crds-hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.crds-stat-item { text-align: center; }
.crds-stat-item .stat-icon {
  font-size: 1.6rem;
  color: var(--crds-gold);
  display: block;
  margin-bottom: 0.25rem;
}
.crds-stat-item .stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SECTIONS ===== */
.crds-section { padding: 4.5rem 0; }
.crds-section-gray { background: var(--crds-gray); }

.crds-section-title { text-align: center; margin-bottom: 3rem; }
.crds-section-title h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--crds-blue);
  margin-bottom: 0.5rem;
}
.crds-section-title p { color: var(--crds-muted); font-size: 1rem; max-width: 480px; margin: 0 auto; }

.crds-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--crds-cyan), var(--crds-blue));
  border-radius: 2px;
  margin: 0.75rem auto 1rem;
}
.crds-divider-left { margin-left: 0; margin-right: 0; }

/* ===== FONDS CARDS ===== */
.crds-fond-card {
  background: white;
  border-radius: var(--crds-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--crds-shadow-sm);
  border: 1px solid var(--crds-border);
  transition: var(--crds-transition);
  text-decoration: none;
  display: block;
  height: 100%;
  color: inherit;
}
.crds-fond-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--crds-shadow-lg);
  border-color: var(--crds-cyan);
  text-decoration: none;
  color: inherit;
}

.crds-fond-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.7rem;
  transition: var(--crds-transition);
}
.crds-fond-card:hover .crds-fond-icon { transform: scale(1.1); }
.crds-fond-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--crds-blue);
  margin-bottom: 0.5rem;
}
.crds-fond-card p { font-size: 0.87rem; color: var(--crds-muted); margin: 0 0 0.75rem; }

.crds-fond-badge {
  display: inline-block;
  background: var(--crds-gray);
  color: var(--crds-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  transition: var(--crds-transition);
}
.crds-fond-card:hover .crds-fond-badge {
  background: var(--crds-cyan);
  color: white;
}

/* ===== GLOBAL BUTTONS ===== */
.btn-crds-primary {
  background: var(--crds-blue);
  color: white;
  border: 2px solid var(--crds-blue);
  border-radius: 30px;
  padding: 0.65rem 1.8rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--crds-transition);
  cursor: pointer;
}
.btn-crds-primary:hover {
  background: var(--crds-blue-dark);
  border-color: var(--crds-blue-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,58,123,0.3);
}

/* ===== ABOUT SECTION ===== */
.crds-about-img {
  border-radius: var(--crds-radius);
  box-shadow: var(--crds-shadow);
  width: 100%;
  height: auto;
}

.crds-about-content { color: var(--crds-text); line-height: 1.85; }
.crds-about-content p { margin-bottom: 1rem; text-align: justify; }

/* ===== CTA SECTION ===== */
.crds-cta {
  background: linear-gradient(135deg, var(--crds-blue) 0%, var(--crds-blue-light) 100%);
  padding: 4.5rem 0;
}
.crds-cta h2 {
  color: white;
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}
.crds-cta p {
  color: rgba(255,255,255,0.78);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.crds-cta-form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.crds-cta-form .form-control {
  border-radius: 30px !important;
  border: none !important;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  flex: 1;
  min-width: 220px;
  box-shadow: none !important;
}
.crds-cta-form .btn-cta-submit {
  background: var(--crds-gold);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 0.75rem 1.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--crds-transition);
  cursor: pointer;
  white-space: nowrap;
}
.crds-cta-form .btn-cta-submit:hover {
  background: var(--crds-orange);
  transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.crds-footer {
  background: var(--crds-blue-dark);
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 0 0;
}
.crds-footer-logo { margin-bottom: 1rem; }
.crds-footer-logo img { height: 50px; width: auto; }
.crds-footer-logo-name {
  display: block;
  color: white;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  line-height: 1.3;
  max-width: 240px;
}
.crds-footer p { font-size: 0.87rem; line-height: 1.8; color: rgba(255,255,255,0.6); }
.crds-footer-title {
  color: var(--crds-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
.crds-footer-links { list-style: none; padding: 0; margin: 0; }
.crds-footer-links li { margin-bottom: 0.5rem; }
.crds-footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color 0.2s;
}
.crds-footer-links a:hover { color: var(--crds-cyan); }
.crds-footer-contact {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.6rem;
}
.crds-footer-contact i { color: var(--crds-cyan); flex-shrink: 0; margin-top: 0.2rem; }
.crds-footer-contact a { color: rgba(255,255,255,0.6); text-decoration: none; }
.crds-footer-contact a:hover { color: var(--crds-cyan); }

.crds-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}

/* ===== AtoM overrides ===== */
.actions { background-color: var(--crds-blue) !important; }

/* Hide AtoM default footer content (keep hidden js elements) */
footer#js-footer-visible { display: none; }

/* Remove top padding on homepage (hero is full-bleed from container) */
#wrapper.crds-homepage-wrapper {
  padding-top: 0 !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
#wrapper.crds-homepage-wrapper #main-column {
  padding: 0;
}
