/* =========================================================
   LA SENTINELLE MÉDIA - Styles journalistiques et typographiques
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;0,900;1,600;1,700&display=swap');

:root {
  --primary-navy: #0c1b2a;
  --secondary-navy: #162a40;
  --accent-gold: #c59b27;
  --accent-red: #c91818;
  --paper-bg: #fbfbf9;
  --paper-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-press: #e2e8f0;
  --font-serif-title: 'Playfair Display', Georgia, serif;
  --font-serif-body: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-masthead: 'Cinzel', serif;
}

.dark {
  --primary-navy: #070d14;
  --secondary-navy: #0e1b29;
  --accent-gold: #e5b338;
  --accent-red: #e63946;
  --paper-bg: #090e15;
  --paper-card: #131b27;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border-press: #233044;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-sans);
  background-color: var(--paper-bg);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: rgba(197, 155, 39, 0.2);
}

/* Police presse titres */
.font-masthead {
  font-family: var(--font-masthead);
  letter-spacing: 0.08em;
}

.font-serif-title {
  font-family: var(--font-serif-title);
  letter-spacing: -0.015em;
}

.font-serif-body {
  font-family: var(--font-serif-body);
}

/* Bordures style papier journal */
.border-newspaper-t {
  border-top: 3px double var(--primary-navy);
}

.border-newspaper-b {
  border-bottom: 3px double var(--primary-navy);
}

.dark .border-newspaper-t,
.dark .border-newspaper-b {
  border-color: #334155;
}

/* Lettrine (Drop Cap) journalistique */
.drop-cap::first-letter {
  font-family: var(--font-serif-title);
  float: left;
  font-size: 3.8rem;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 10px;
  padding-bottom: 2px;
  color: var(--accent-red);
  font-weight: 700;
}

/* Citation en exergue (Pull Quote) */
.pull-quote {
  font-family: var(--font-serif-title);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: #1e293b;
  border-left: 4px solid var(--accent-red);
  padding: 1.2rem 1.5rem;
  margin: 1.8rem 0;
  background-color: rgba(201, 24, 24, 0.04);
  border-radius: 0 8px 8px 0;
}

.dark .pull-quote {
  color: #f1f5f9;
  background-color: rgba(230, 57, 70, 0.08);
}

/* Encadré "À retenir" / Context */
.takeaway-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid var(--accent-gold);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.dark .takeaway-box {
  background-color: #1a2433;
  border-color: #334155;
}

/* Animation Ticker Alerte Info */
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 35s linear infinite;
}

.ticker-wrap:hover .ticker-content {
  animation-play-state: paused;
}

/* Ligne séparatrice fine de presse */
.rule-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-press), transparent);
}

/* Effet de survol sur les cartes d'articles */
.article-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
}

.article-card:hover .article-title {
  color: var(--accent-red);
}

/* Tailles de police dynamiques de lecture */
.reading-text-sm {
  font-size: 1.05rem;
  line-height: 1.7;
}

.reading-text-base {
  font-size: 1.2rem;
  line-height: 1.8;
}

.reading-text-lg {
  font-size: 1.38rem;
  line-height: 1.85;
}

/* Personnalisation de la barre de défilement */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #0b131e;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ================= AMÉLIORATIONS RESPONSIVE MOBILE ================= */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tiroir Mobile (Mobile Navigation Drawer) */
#mobile-drawer-overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-drawer-panel {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Barres de défilement masquées pour swipe fluide */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* Évite le zoom automatique indésirable sur iOS et Android sur focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Ergonomie pour les zones de frappe sur écran tactile */
  textarea#form-content {
    min-height: 200px;
  }

  /* Padding et espacement des boutons mobiles */
  .mobile-btn {
    min-height: 42px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Garantit que les images et iframes ne dépassent jamais la largeur de l'écran */
  img, iframe, video {
    max-width: 100% !important;
    height: auto;
  }
}

/* ================= DISPARITION DU BOUTON INSTALLER LORSQUE L'APP EST INSTALLÉE ================= */
html.app-installed [data-pwa-install],
html.app-installed [onclick*="triggerPWAInstall"],
html.app-installed #topbar-install-pwa-btn,
html.app-installed #nav-install-pwa-btn,
html.app-installed #mobile-quick-install-pwa-btn,
html.app-installed #drawer-install-pwa-btn,
html.app-installed #footer-install-pwa-zone,
html.app-installed #pwa-install-banner,
html.app-installed #pwa-ios-modal {
  display: none !important;
}

/* Réajustement ergonomique des barres d'actions lorsque l'app est installée */
html.app-installed #mobile-quick-actions-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.app-installed #drawer-quick-actions {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

