/* ============================================================
   OPM Madagascar — Custom CSS
   Typographie : Playfair Display (titres) + Inter (corps)
   Palette : bleu missionnaire + or chaud
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---- Tokens ---- */
:root {
  /* Blues */
  --opm-primary:       #5386e4;
  --opm-primary-dark:  #3a6bc7;
  --opm-primary-light: #eef2fc;
  --opm-primary-rgb:   83, 134, 228;

  /* Gold véritable */
  --opm-gold:          #c99a3c;
  --opm-gold-dark:     #a87d2a;
  --opm-gold-light:    #f9f1e0;
  --opm-gold-rgb:      201, 154, 60;

  /* Surfaces */
  --opm-dark:          #2a2940;
  --opm-dark-rgb:      42, 41, 64;
  --opm-text:          #1e1d30;
  --opm-surface:       #ffffff;
  --opm-surface-muted: #f7f8fb;

  /* Effets */
  --radius-sm:    0.375rem;
  --radius-md:    0.625rem;
  --radius-lg:    0.875rem;
  --radius-xl:    1.25rem;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-card:  0 2px 12px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --shadow-hover: 0 10px 32px rgba(var(--opm-primary-rgb),.18), 0 2px 8px rgba(0,0,0,.06);
  --shadow-gold:  0 10px 32px rgba(var(--opm-gold-rgb),.22), 0 2px 8px rgba(0,0,0,.06);

  /* Transitions */
  --ease-out:   cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in:    cubic-bezier(0.4, 0.0, 1, 1);
  --ease-std:   cubic-bezier(0.4, 0.0, 0.2, 1);
  --t-fast:     150ms;
  --t-base:     220ms;
  --t-slow:     350ms;

  --navbar-height: 60px;
}

/* ============================================================
   Base — Typographie et corps
   ============================================================ */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--opm-surface);
  color: var(--opm-text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

h1, h2, h3, h4,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
}

h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

/* ============================================================
   Couleurs utilitaires Bootstrap custom
   ============================================================ */
.bg-opm-primary        { background-color: var(--opm-primary) !important; }
.bg-opm-primary-light  { background-color: var(--opm-primary-light) !important; }
.bg-opm-gold           { background-color: var(--opm-gold) !important; }
.bg-opm-dark           { background-color: var(--opm-dark) !important; color: #fff; }
.bg-opm-dark .text-muted,
.bg-opm-dark a.text-muted   { color: rgba(255,255,255,.65) !important; }
.bg-opm-dark a.text-muted:hover { color: #fff !important; }
.bg-opm-dark hr        { border-color: rgba(255,255,255,.12) !important; }

.text-opm-primary { color: var(--opm-primary) !important; }
.text-opm-gold    { color: var(--opm-gold) !important; }

.bg-light { background-color: var(--opm-surface-muted) !important; }
.card, .card-body, .content-body { background-color: var(--opm-surface); }

/* ============================================================
   Boutons
   ============================================================ */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: .01em;
  border-radius: var(--radius-md);
  transition: background-color var(--t-base) var(--ease-std),
              border-color var(--t-base) var(--ease-std),
              box-shadow var(--t-base) var(--ease-std),
              transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn-opm-primary {
  background-color: var(--opm-primary);
  border-color: var(--opm-primary);
  color: #fff;
}
.btn-opm-primary:hover, .btn-opm-primary:focus {
  background-color: var(--opm-primary-dark);
  border-color: var(--opm-primary-dark);
  box-shadow: 0 4px 16px rgba(var(--opm-primary-rgb),.35);
  color: #fff;
}

.btn-outline-opm-primary {
  color: var(--opm-primary);
  border-color: var(--opm-primary);
  background: transparent;
}
.btn-outline-opm-primary:hover {
  background-color: var(--opm-primary);
  border-color: var(--opm-primary);
  box-shadow: 0 4px 16px rgba(var(--opm-primary-rgb),.25);
  color: #fff;
}

.btn-opm-gold {
  background-color: var(--opm-gold);
  border-color: var(--opm-gold);
  color: #fff;
  font-weight: 600;
}
.btn-opm-gold:hover, .btn-opm-gold:focus {
  background-color: var(--opm-gold-dark);
  border-color: var(--opm-gold-dark);
  box-shadow: 0 4px 16px rgba(var(--opm-gold-rgb),.40);
  color: #fff;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  height: var(--navbar-height);
  transition: background-color var(--t-slow) var(--ease-std),
              box-shadow var(--t-slow) var(--ease-std),
              backdrop-filter var(--t-slow) var(--ease-std);
}
.navbar.bg-opm-primary { background-color: var(--opm-primary) !important; }

/* Glassmorphism ajouté via JS au scroll */
.navbar.navbar-scrolled {
  background-color: rgba(var(--opm-primary-rgb), 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,.15) !important;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: .01em;
}

.navbar-nav .nav-link {
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: .01em;
  padding: .45rem .75rem !important;
  position: relative;
  transition: color var(--t-fast) var(--ease-std);
}
.navbar-dark .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: .75rem;
  right: .75rem;
  height: 2px;
  background: var(--opm-gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--t-base) var(--ease-out);
}
.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link.active::after { transform: scaleX(1); }

.navbar-dark .navbar-nav .nav-link.active { color: #fff !important; font-weight: 600; }

/* ============================================================
   Hero section
   ============================================================ */
.hero-section {
  background:
    linear-gradient(135deg,
      rgba(42,41,64,.82) 0%,
      rgba(58,107,199,.70) 55%,
      rgba(83,134,228,.55) 100%),
    url('/media/vatican.jpg') center/cover no-repeat;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section::before { content: none; }
.hero-section::after  { content: none; }

/* Crédit photo */
.hero-photo-credit {
  position: absolute;
  bottom: .5rem;
  right: .75rem;
  font-size: .68rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .02em;
  z-index: 2;
}
.hero-section > * { position: relative; z-index: 1; }

.cross-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 240px;
  position: relative;
}
.cross-emblem::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--opm-gold-rgb),.12) 0%, transparent 70%);
  animation: pulse-gold 3s ease-in-out infinite;
}
.hero-logo {
  max-width: 190px;
  opacity: .9;
  filter: drop-shadow(0 4px 24px rgba(var(--opm-gold-rgb),.30));
  animation: float 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes pulse-gold {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.08); }
}

.letter-spacing { letter-spacing: 0.18em; }

/* ============================================================
   Stats bar
   ============================================================ */
.stats-bar {
  background: linear-gradient(90deg,
    rgba(var(--opm-gold-rgb),.95) 0%,
    rgba(var(--opm-gold-rgb),1) 50%,
    rgba(var(--opm-gold-rgb),.95) 100%);
  position: relative;
  overflow: hidden;
}
.stats-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat-label {
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .25rem;
}

/* ============================================================
   Section dividers / titres
   ============================================================ */
.opm-divider {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--opm-gold), transparent);
  opacity: .6;
}

.section-title {
  font-family: 'Playfair Display', serif;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--opm-primary), var(--opm-gold));
  border-radius: 2px;
  margin-top: .5rem;
}
.section-title.text-center::after { margin-left: auto; margin-right: auto; }

/* ============================================================
   Cartes articles
   ============================================================ */
.card {
  border-radius: var(--radius-lg) !important;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
  border: none !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover) !important;
}

.card-img-top {
  border-radius: 0 !important;
  transition: transform var(--t-slow) var(--ease-out);
  overflow: hidden;
}
.article-card:hover .card-img-top { transform: scale(1.04); }

.card-body { padding: 1.25rem 1.35rem; }

/* Badge catégorie */
.badge {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .04em;
  border-radius: var(--radius-sm);
}
.badge.bg-opm-primary        { background-color: var(--opm-primary) !important; }
.badge.bg-opm-primary-light  {
  background-color: var(--opm-primary-light) !important;
  color: var(--opm-primary) !important;
}

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  background: linear-gradient(135deg,
    var(--opm-primary-dark) 0%,
    var(--opm-primary) 45%,
    var(--opm-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--opm-primary), var(--opm-gold), var(--opm-primary));
}
.page-header a,
.page-header h1,
.page-header h2,
.page-header h3,
.page-header p { color: #fff; }

/* ============================================================
   Images
   ============================================================ */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-cover-featured {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}
.img-cover-featured-placeholder { height: 350px; border-radius: var(--radius-lg); }
.img-cover-article {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}
.img-cover-card {
  width: 100%;
  height: 210px;
  object-fit: cover;
}
.img-cover-card-placeholder { height: 210px; }
.img-cover-blog {
  width: 100%;
  height: 185px;
  object-fit: cover;
}
.img-cover-blog-placeholder { height: 185px; }
.img-cover-review {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}
.img-thumb-related {
  width: 72px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Icônes placeholder
   ============================================================ */
.icon-placeholder-xl { font-size: 5rem;  opacity: .25; }
.icon-placeholder-lg { font-size: 3rem;  opacity: .30; }
.icon-placeholder-md { font-size: 2.5rem; opacity: .40; }
.icon-xl             { font-size: 3rem; }
.icon-lg             { font-size: 2.5rem; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar-lg {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.avatar-placeholder { width: 100px; height: 100px; }
.login-icon { width: 60px; height: 60px; }

/* ============================================================
   CTA section
   ============================================================ */
.cta-section {
  background: linear-gradient(135deg,
    var(--opm-primary) 0%,
    var(--opm-primary-dark) 60%,
    var(--opm-dark) 100%);
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--opm-gold-rgb),.12) 0%, transparent 70%);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background-color: var(--opm-dark) !important;
  color: #fff;
  border-top: 3px solid var(--opm-gold);
  position: relative;
}
.site-footer .footer-heading {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--opm-gold) !important;
  margin-bottom: 1rem;
}
.site-footer a.text-muted {
  color: rgba(255,255,255,.60) !important;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-std),
              padding-left var(--t-fast) var(--ease-std);
}
.site-footer a.text-muted:hover {
  color: #fff !important;
  padding-left: 4px;
}
.site-footer .text-muted { color: rgba(255,255,255,.60) !important; }
.site-footer hr { border-color: rgba(255,255,255,.10) !important; }

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75) !important;
  font-size: 1.1rem;
  text-decoration: none !important;
  transition: background var(--t-base) var(--ease-std),
              color var(--t-base) var(--ease-std),
              transform var(--t-fast) var(--ease-out);
}
.social-icon:hover {
  background: var(--opm-gold);
  color: #fff !important;
  transform: translateY(-3px);
}

/* ============================================================
   Scroll-to-top
   ============================================================ */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--opm-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(var(--opm-primary-rgb),.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-base) var(--ease-std),
              transform var(--t-base) var(--ease-std),
              background var(--t-fast) var(--ease-std);
  z-index: 1000;
}
#scroll-top.visible { opacity: 1; transform: translateY(0); }
#scroll-top:hover   { background: var(--opm-primary-dark); }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  font-size: .85rem;
  font-weight: 400;
  background: none;
  padding: 0;
}
.breadcrumb-item a {
  color: var(--opm-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
.breadcrumb-item a:hover { color: var(--opm-primary-dark); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--opm-gold); }

/* ============================================================
   Dashboard sidebar
   ============================================================ */
.sidebar-nav { min-height: calc(100vh - var(--navbar-height)); }
.sidebar-sticky { position: sticky; top: 80px; }
.sidebar .nav-link {
  color: var(--opm-text);
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease-std),
              color var(--t-fast) var(--ease-std);
}
.sidebar .nav-link:hover:not(.active) {
  background: var(--opm-primary-light);
  color: var(--opm-primary);
}

.badge-log { height: fit-content; flex-shrink: 0; margin-top: .15rem; }

/* ============================================================
   Contenu riche (article)
   ============================================================ */
.content-body {
  line-height: 1.85;
  color: var(--opm-text);
  font-size: 1.05rem;
}
.content-body h1,
.content-body h2,
.content-body h3 {
  font-family: 'Playfair Display', serif;
  color: var(--opm-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.content-body h2 {
  border-bottom: 2px solid var(--opm-gold-light);
  padding-bottom: .5rem;
}
.content-body blockquote {
  border-left: 4px solid var(--opm-gold);
  background: var(--opm-gold-light);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
  font-style: italic;
  font-family: 'Playfair Display', serif;
  font-size: 1.05em;
  color: #444;
}
.content-body img  { max-width: 100%; border-radius: var(--radius-md); }
.content-body a    { color: var(--opm-primary); }
.content-body a:hover { color: var(--opm-primary-dark); }

/* ============================================================
   Forms
   ============================================================ */
.form-control,
.form-select {
  border-color: #d0d5e8;
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--t-fast) var(--ease-std),
              box-shadow var(--t-fast) var(--ease-std);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--opm-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--opm-primary-rgb),.18);
}

/* ============================================================
   Alerts
   ============================================================ */
.alert { border-radius: var(--radius-md); }

/* ============================================================
   Typographie utilitaire
   ============================================================ */
.text-xs   { font-size: .75rem; }
.min-vh-75 { min-height: 75vh; }

/* ============================================================
   Animations d'entrée au scroll
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .hero-logo { animation: none; }
  .cross-emblem::before { animation: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hero-section .display-4 { font-size: 2rem; }
  .cross-emblem { width: 180px; height: 180px; }
  .hero-logo { max-width: 140px; }
  #scroll-top { bottom: 1.25rem; right: 1.25rem; }
}
