/* UGP-MOD — Finitions globales partagées
   Cette feuille complète les styles métier sans remplacer Bootstrap, main.css,
   auth.css ni dashboard.css. Elle est chargée en dernier dans les pages HTML. */
:root {
  --site-accent: #0759a8;
  --site-accent-strong: #082f57;
  --site-text: #172b3e;
  --site-muted: #5f7183;
  --site-border: #dce5ee;
  --site-surface: #fff;
  --site-surface-soft: #f4f7fa;
  --site-focus: #f2c318;
  --site-radius-sm: 0.5rem;
  --site-radius-md: 0.875rem;
  --site-shadow-card: 0 0.6rem 1.8rem rgba(10, 36, 64, 0.08);
  --site-control-height: 2.75rem;
}

html {
  scroll-padding-block: 1rem;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

:where(img, svg) {
  max-width: 100%;
  height: auto;
}

:where(.table-responsive, .dashboard-table-wrap, .investment-map-legend) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

:where(h1, h2, h3, h4, h5, h6) {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

:where(p, li, dd, dt, label, small) {
  overflow-wrap: anywhere;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select) {
  min-height: var(--site-control-height);
  max-width: 100%;
}

:where(textarea) {
  max-width: 100%;
  resize: vertical;
}

:where(button, input, select, textarea) {
  font: inherit;
}

:where(button, input[type="submit"], input[type="button"], .btn) {
  touch-action: manipulation;
}

:where(button, input[type="submit"], input[type="button"], select, .btn):disabled,
:where(button, input[type="submit"], input[type="button"], select, .btn)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.68;
}

:where(input, select, textarea):where(:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--site-accent) 35%, transparent);
  outline-offset: 2px;
  border-color: var(--site-accent);
}

:where(button, a, input, select, textarea, summary) {
  -webkit-tap-highlight-color: transparent;
}

/* Barre de contact — surface claire et icônes sociales identifiables. */
.rdc-contact-bar {
  color: #29445b;
  background: #ffffff;
  border-bottom: 2px solid #d7e0ea;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95);
}

.rdc-contact-bar + .navbar-light,
.rdc-contact-bar + .container-fluid {
  border-top: 1px solid #eef2f6;
}

.rdc-contact-bar .rdc-contact-list a,
.rdc-contact-bar .rdc-contact-address {
  color: #29445b !important;
}

.rdc-contact-bar .rdc-contact-list i {
  color: #0759a8;
}

.rdc-contact-bar .rdc-contact-list a:hover {
  color: #0759a8 !important;
}

.rdc-contact-bar .rdc-social-list a {
  border-color: transparent;
  background: transparent;
}

.rdc-contact-bar .rdc-social-list a[aria-label="Facebook"] i { color: #1877f2; }
.rdc-contact-bar .rdc-social-list a[aria-label="X"] i { color: #111111; }
.rdc-contact-bar .rdc-social-list a[aria-label="Instagram"] i { color: #e4405f; }
.rdc-contact-bar .rdc-social-list a[aria-label="LinkedIn"] i { color: #0a66c2; }
.rdc-contact-bar .rdc-social-list a[aria-label="YouTube"] i { color: #ff0000; }

.rdc-contact-bar .rdc-social-list a:hover,
.rdc-contact-bar .rdc-social-list a:focus-visible {
  border-color: currentColor;
  background: rgba(255, 255, 255, .72);
  transform: translateY(-1px);
  outline: none;
}

.rdc-contact-bar .rdc-social-list a[aria-label="Facebook"]:hover,
.rdc-contact-bar .rdc-social-list a[aria-label="Facebook"]:focus-visible { color: #1877f2; }
.rdc-contact-bar .rdc-social-list a[aria-label="X"]:hover,
.rdc-contact-bar .rdc-social-list a[aria-label="X"]:focus-visible { color: #111111; }
.rdc-contact-bar .rdc-social-list a[aria-label="Instagram"]:hover,
.rdc-contact-bar .rdc-social-list a[aria-label="Instagram"]:focus-visible { color: #e4405f; }
.rdc-contact-bar .rdc-social-list a[aria-label="LinkedIn"]:hover,
.rdc-contact-bar .rdc-social-list a[aria-label="LinkedIn"]:focus-visible { color: #0a66c2; }
.rdc-contact-bar .rdc-social-list a[aria-label="YouTube"]:hover,
.rdc-contact-bar .rdc-social-list a[aria-label="YouTube"]:focus-visible { color: #ff0000; }

body.dark-mode .rdc-contact-bar {
  color: #e4edf4;
  background: #172b3b;
  border-bottom-color: #294052;
}

body.dark-mode .rdc-contact-bar + .navbar-light,
body.dark-mode .rdc-contact-bar + .container-fluid {
  border-top-color: #294052;
}

body.dark-mode .rdc-contact-bar .rdc-contact-list a,
body.dark-mode .rdc-contact-bar .rdc-contact-address { color: #e4edf4 !important; }

body.dark-mode .rdc-contact-bar .rdc-social-list a:hover,
body.dark-mode .rdc-contact-bar .rdc-social-list a:focus-visible { background: rgba(255, 255, 255, .1); }

:where(table) {
  max-width: 100%;
}

/* Cartes d’actualités — rendu commun accueil / liste / articles associés. */
.news-grid .news-card,
.related-news-slide.news-card {
  display: flex;
  min-width: 0;
}

.news-grid .blog-item,
.related-news-slide .blog-item {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 0.95rem !important;
  background: var(--site-surface);
  box-shadow: var(--site-shadow-card);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.news-grid .blog-item:hover,
.news-grid .blog-item:focus-within,
.related-news-slide .blog-item:hover,
.related-news-slide .blog-item:focus-within {
  border-color: color-mix(in srgb, var(--site-accent) 32%, var(--site-border));
  box-shadow: 0 1rem 2.25rem rgba(10, 36, 64, .12);
  transform: translateY(-4px);
}

.news-grid .blog-img-inner,
.related-news-slide .blog-img-inner {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #dfeaf3;
}

.news-grid .blog-img-inner img,
.related-news-slide .blog-img-inner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
}

.news-grid .blog-info,
.related-news-slide .blog-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 2.85rem;
  padding: .65rem 1rem;
  border: 0 !important;
  border-bottom: 1px solid var(--site-border) !important;
  background: var(--site-surface-soft);
  color: var(--site-muted);
  font-size: .76rem;
}

.news-grid .blog-info > *,
.related-news-slide .blog-info > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-grid .blog-info span,
.related-news-slide .blog-info span {
  color: var(--site-accent) !important;
  font-weight: 700;
  text-align: right;
}

.news-grid .blog-content,
.related-news-slide .blog-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 1.35rem 1.4rem 1.45rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
}

.news-grid .blog-content > a.h4,
.related-news-slide .blog-content > a.h4 {
  display: -webkit-box;
  min-height: 3.25rem;
  margin-bottom: .7rem;
  overflow: hidden;
  color: var(--site-accent-strong);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-grid .blog-content > p.my-3,
.related-news-slide .blog-content > p.my-3 {
  display: -webkit-box;
  min-height: 4.35rem;
  margin: .35rem 0 1.15rem !important;
  overflow: hidden;
  color: var(--site-muted);
  font-size: .93rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.news-grid .blog-content > .btn,
.related-news-slide .blog-content > .btn {
  align-self: flex-start;
  margin-top: auto;
}

body.dark-mode .news-grid .blog-item,
body.dark-mode .related-news-slide .blog-item {
  border-color: #294052;
  background: #162c3d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

body.dark-mode .news-grid .blog-info,
body.dark-mode .related-news-slide .blog-info {
  border-color: #294052 !important;
  background: #142a3c;
  color: #b7c8d6;
}

body.dark-mode .news-grid .blog-content > a.h4,
body.dark-mode .related-news-slide .blog-content > a.h4 {
  color: #e8f1fa;
}

body.dark-mode .news-grid .blog-content > p.my-3,
body.dark-mode .related-news-slide .blog-content > p.my-3 {
  color: #b4c4d3;
}

:where(iframe, video, canvas) {
  max-width: 100%;
}

@supports not (text-wrap: pretty) {
  :where(h1, h2, h3, h4, h5, h6) { overflow-wrap: break-word; }
}

@media (max-width: 640px) {
  :where(.container, .container-fluid) {
    scroll-margin-inline: 0.75rem;
  }
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select) {
    font-size: max(16px, 1em);
  }
  :where(textarea) {
    font-size: max(16px, 1em);
  }
  .news-grid .blog-content,
  .related-news-slide .blog-content {
    padding: 1.1rem 1rem 1.2rem !important;
  }
  .news-grid .blog-content > a.h4,
  .related-news-slide .blog-content > a.h4 {
    font-size: 1.04rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :where(button, .btn, .skip-link) { box-shadow: none !important; }
  :where(a) { color: inherit; }
}
