/* Les Voitures — PWA Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cp:  #EF4242;
  --cs:  #333333;
  --cbg: #FFFFFF;
  --csu: #F5F5F5;
  --hh:  46px;
  --nh:  52px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.10);
  --trans: .2s ease;
}

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cbg);
  color: var(--cs);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Splash ─────────────────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--cp);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; transition: opacity .4s ease;
}
.splash-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.splash-name { color: #fff; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.splash-dot  { width: 8px; height: 8px; background: rgba(255,255,255,.6); border-radius: 50%; animation: pulse 1s infinite; margin-top: 8px; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .4; } }
.splash.fade-out { opacity: 0; pointer-events: none; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.app-header {
  /* height accounts for iPhone notch / status bar */
  height: calc(var(--hh) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--cbg);
  border-bottom: 1px solid rgba(0,0,0,.08);
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  flex-shrink: 0;
}
.header-inner {
  height: var(--hh); max-width: 780px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
}
.logo-btn {
  display: flex; align-items: center; flex-shrink: 0;
  background: transparent; border: none; cursor: pointer; padding: 3px;
  border-radius: 6px; transition: opacity var(--trans);
}
.logo-btn:active { opacity: .7; }
.header-logo { height: 22px; width: auto; object-fit: contain; max-width: 110px; }

/* Custom header buttons zone — prend tout l'espace restant */
.header-custom-btns {
  flex: 1; display: flex; align-items: center; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  justify-content: flex-end; padding-right: 4px;
}
.header-custom-btns::-webkit-scrollbar { display: none; }

/* Boutons personnalisés du header */
.hdr-btn {
  flex-shrink: 0; padding: 4px 10px; border-radius: 16px;
  font-size: 11px; font-weight: 700;
  background: var(--csu); border: none; cursor: pointer;
  color: var(--cs); text-decoration: none; display: inline-flex; align-items: center;
  transition: all var(--trans); white-space: nowrap;
}
.hdr-btn:hover, .hdr-btn:active { background: var(--cp); color: #fff; }

.icon-btn {
  width: 30px; height: 30px; border: none; background: transparent;
  cursor: pointer; color: #777; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans);
}
.icon-btn:hover, .icon-btn:active { background: var(--csu); }
.icon-btn.is-active { background: color-mix(in srgb, var(--cp) 15%, transparent); color: var(--cp); }

/* ─── Pull-to-refresh indicator ─────────────────────────────────────────── */
.pull-indicator {
  height: 0; overflow: hidden; opacity: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cbg); color: #aaa;
  pointer-events: none;
}
.pull-indicator.pull-ready  { opacity: 1; color: var(--cp); }
.pull-indicator.pull-refreshing { opacity: 1; }
.pull-icon { transition: transform .2s ease; display: block; flex-shrink: 0; }
.pull-indicator.pull-ready .pull-icon { transform: rotate(180deg); }
.pull-indicator.pull-refreshing .pull-icon {
  animation: ptr-spin .7s linear infinite;
  transform: none;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ─── Main scrollable area ───────────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--nh) + env(safe-area-inset-bottom, 0px));
}

/* ─── Views ──────────────────────────────────────────────────────────────── */
.view { display: none; min-height: 100%; animation: fadeIn .2s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── Article cards ──────────────────────────────────────────────────────── */
.articles-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 12px; }

.article-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.07);
  overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: transform var(--trans), box-shadow var(--trans);
}
.article-card:active { transform: scale(.985); box-shadow: none; }

.article-card-img-wrap { display: block; }
.article-card-img {
  width: 100%; aspect-ratio: 3/2; object-fit: cover;
  background: var(--csu); display: block;
}
.article-card-img-placeholder { width: 100%; aspect-ratio: 3/2; background: linear-gradient(135deg, var(--csu) 25%, #eee 50%, var(--csu) 75%); }

.article-card-body { padding: 12px 14px 14px; }

.article-card-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.article-card-cat  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--cp); }

.article-card-title { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--cs); margin-bottom: 6px; }

.article-card-excerpt { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.article-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #999; }
.article-card-read  { display: flex; align-items: center; gap: 4px; }

/* ─── Card fav button ───────────────────────────────────────────────────── */
.article-card-img-wrap { position: relative; overflow: hidden; }

.card-fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; gap: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform var(--trans), background var(--trans);
  z-index: 2;
  padding: 0;
}
.card-fav-btn:active { transform: scale(.88); }

.card-fav-icon { color: #aaa; transition: color var(--trans), fill var(--trans); flex-shrink: 0; }
.card-fav-plus {
  position: absolute; bottom: 4px; right: 4px;
  font-size: 10px; font-weight: 800; color: #aaa;
  line-height: 1; transition: color var(--trans);
}

.card-fav-btn.is-fav { background: #fef2f2; }
.card-fav-btn.is-fav .card-fav-icon { color: var(--cp); fill: var(--cp); }
.card-fav-btn.is-fav .card-fav-plus { color: var(--cp); }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card { background: #fff; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.07); overflow: hidden; }
.skeleton-img  { aspect-ratio: 3/2; }
.skeleton-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 14px; border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full   { width: 100%; }

/* ─── Loader rows ────────────────────────────────────────────────────────── */
.loader-row { display: flex; justify-content: center; padding: 20px; }
.spinner {
  width: 28px; height: 28px; border: 3px solid rgba(239,66,66,.2);
  border-top-color: var(--cp); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.list-end { text-align: center; color: #bbb; font-size: 13px; padding: 20px; }

/* ─── Back button ────────────────────────────────────────────────────────── */
.back-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 16px; font-size: 15px; font-weight: 600;
  color: var(--cp); background: transparent; border: none; cursor: pointer;
  width: 100%;
}
.back-btn:active { opacity: .7; }

/* ─── Article detail ─────────────────────────────────────────────────────── */
.article-body { padding: 0 0 40px; }

.article-hero { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--csu); }

.article-inner { padding: 20px 16px; max-width: 680px; margin: 0 auto; }
.article-meta-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-size: 12px; color: #999;
}
.article-cat-badge { color: var(--cp); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.article-title { font-size: 22px; font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.article-byline { font-size: 13px; color: #888; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.article-byline span { color: #bbb; }

.article-actions {
  display: flex; gap: 10px; margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--csu);
}
.btn-fav, .btn-share {
  flex: 1; padding: 10px 14px; border-radius: 8px; border: 2px solid var(--cp);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--trans);
}
.btn-fav   { background: transparent; color: var(--cp); }
.btn-share { background: var(--cp); color: #fff; border-color: var(--cp); }
.btn-fav.is-fav { background: var(--cp); color: #fff; }
.btn-fav:active, .btn-share:active { opacity: .8; transform: scale(.97); }

/* Article content WP HTML */
.article-content-body { font-size: 16px; line-height: 1.7; color: #333; }
.article-content-body h1,.article-content-body h2,.article-content-body h3 { font-weight: 700; margin: 24px 0 10px; color: var(--cs); }
.article-content-body h2 { font-size: 20px; }
.article-content-body h3 { font-size: 17px; }
.article-content-body p  { margin-bottom: 16px; }
.article-content-body a  { color: var(--cp); text-decoration: none; }
.article-content-body a:hover { text-decoration: underline; }
.article-content-body img { width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.article-content-body figure { margin: 16px 0; }
.article-content-body figcaption { font-size: 12px; color: #999; text-align: center; margin-top: 6px; }
.article-content-body blockquote { border-left: 4px solid var(--cp); padding-left: 14px; color: #555; font-style: italic; margin: 16px 0; }
.article-content-body ul, .article-content-body ol { padding-left: 20px; margin-bottom: 16px; }
.article-content-body li { margin-bottom: 6px; }
.article-content-body iframe { width: 100%; border-radius: 8px; border: none; }
.article-content-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-content-body th, .article-content-body td { padding: 8px; border: 1px solid #e0e0e0; }
.article-content-body th { background: var(--csu); }

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-bar-wrap { padding: 12px 12px 4px; position: sticky; top: 0; background: var(--cbg); z-index: 10; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--csu); border-radius: 12px; padding: 0 14px;
  border: 2px solid transparent; transition: border-color var(--trans);
}
.search-bar:focus-within { border-color: var(--cp); background: #fff; }
.search-bar svg { flex-shrink: 0; color: #999; }
#search-input {
  flex: 1; height: 44px; border: none; background: transparent;
  font-size: 16px; color: var(--cs); outline: none;
}
.search-clear-btn { border: none; background: transparent; cursor: pointer; color: #999; padding: 4px; }

/* ─── Categories — sections avec bandeaux ────────────────────────────────── */
/* ─── Brand filter (Constructeurs) ──────────────────────────────────────── */
.brand-filter-bar {
  padding: 12px 16px 8px;
  background: var(--cbg);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.brand-select {
  width: 100%; padding: 10px 14px; font-size: 14px; font-weight: 600;
  color: var(--cs); background: var(--csu);
  border: 1.5px solid rgba(0,0,0,.1); border-radius: 10px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer;
}
.brand-select:focus { outline: none; border-color: var(--cp); }

.categories-grid { padding: 8px 0 16px; }

.cat-section { margin-bottom: 20px; }

.cat-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 10px;
}
.cat-section-name { font-size: 16px; font-weight: 800; color: var(--cs); margin: 0; }
.cat-section-more {
  font-size: 12px; font-weight: 700; color: var(--cp);
  background: none; border: none; cursor: pointer; padding: 4px 0;
  white-space: nowrap; flex-shrink: 0;
}
.cat-section-more:active { opacity: .7; }

/* Bandeau horizontal d'articles */
.cat-strip {
  display: flex; gap: 10px; padding: 0 16px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }

/* État chargement du bandeau */
.cat-strip-loading {
  justify-content: center; align-items: center;
  height: 120px; padding: 0;
}

/* Carte mini dans le bandeau */
.cat-strip-card {
  flex-shrink: 0; width: 150px; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 1px 6px rgba(0,0,0,.07); cursor: pointer;
  transition: transform var(--trans);
}
.cat-strip-card:active { transform: scale(.96); }
.cat-strip-img {
  width: 150px; height: 95px; object-fit: cover;
  display: block; background: var(--csu);
}
.cat-strip-img-ph {
  width: 150px; height: 95px;
  background: linear-gradient(135deg, var(--csu) 25%, #eee 50%, var(--csu) 75%);
  background-size: 200%; animation: shimmer 1.4s infinite;
}
.cat-strip-body { padding: 7px 9px 9px; }
.cat-strip-title {
  font-size: 11px; font-weight: 700; line-height: 1.35; color: var(--cs);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-strip-date { font-size: 10px; color: #aaa; margin-top: 4px; }

/* Séparateur entre sections */
.cat-section + .cat-section { border-top: 1px solid var(--csu); padding-top: 16px; }

/* ─── Section title ──────────────────────────────────────────────────────── */
.section-title { padding: 4px 16px 8px; font-size: 18px; font-weight: 800; color: var(--cs); }

/* ─── Category sort bar ──────────────────────────────────────────────────── */
.cat-sort-bar {
  display: flex; gap: 6px; padding: 4px 16px 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-sort-bar::-webkit-scrollbar { display: none; }
.cat-sort-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; border: 1.5px solid rgba(0,0,0,.12);
  background: var(--csu); color: var(--cs); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.cat-sort-btn.is-active {
  background: var(--cp); color: #fff; border-color: var(--cp);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; gap: 16px;
  color: #ccc; text-align: center;
}
.empty-state p  { font-size: 16px; font-weight: 600; color: #aaa; }
.empty-state small { font-size: 13px; color: #bbb; }

/* ─── Bottom nav ─────────────────────────────────────────────────────────── */
.bottom-nav {
  height: calc(var(--nh) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--cbg);
  border-top: 1px solid rgba(0,0,0,.1);
  display: flex; align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  flex-shrink: 0;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border: none; background: transparent; cursor: pointer;
  color: #aaa; font-size: 9px; font-weight: 600;
  padding: 5px 4px; transition: color var(--trans); position: relative;
}
.nav-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.nav-btn.active { color: var(--cp); }
.nav-btn.active svg { stroke-width: 2.4; }
.nav-btn:active { opacity: .7; }
.nav-icon-wrap { position: relative; }
.fav-badge {
  position: absolute; top: -5px; right: -7px;
  background: var(--cp); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 10px; padding: 1px 5px; min-width: 16px; text-align: center;
  border: 2px solid var(--cbg);
}

/* ─── Category fav button (view-category header) ────────────────────────── */
.cat-view-header {
  display: flex; align-items: center; padding: 0 10px 0 0;
}
.cat-view-header .section-title { flex: 1; }
.cat-view-fav { flex-shrink: 0; color: #bbb; }
.cat-view-fav svg { stroke: currentColor; }
.cat-view-fav.is-fav { color: var(--cp); }
.cat-view-fav.is-fav svg { fill: var(--cp); }

/* ─── Favorites — sections (catégories + articles) ──────────────────────── */
.fav-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #aaa; padding: 14px 16px 6px; margin: 0;
}
.fav-cats-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px;
}
.fav-cat-chip {
  display: flex; align-items: center;
  background: var(--csu); border-radius: 20px;
  border: 1.5px solid rgba(0,0,0,.08); overflow: hidden;
}
.fav-cat-chip-main {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 12px; font-size: 13px; font-weight: 600;
  color: var(--cs); background: none; border: none; cursor: pointer;
}
.fav-cat-chip-main:active { opacity: .7; }
.fav-cat-chip-main svg { flex-shrink: 0; stroke: var(--cp); }
.fav-cat-chip-remove {
  padding: 7px 10px; font-size: 11px; color: #bbb;
  background: none; border: none; border-left: 1px solid rgba(0,0,0,.08); cursor: pointer;
}
.fav-cat-chip-remove:active { color: var(--cp); }

/* ─── Install prompt ─────────────────────────────────────────────────────── */
.install-prompt {
  position: fixed; bottom: calc(var(--nh) + env(safe-area-inset-bottom) + 12px); left: 12px; right: 12px;
  background: #fff; border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15); z-index: 200;
  animation: slideUp .3s ease;
  border: 1px solid rgba(0,0,0,.08);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.install-icon { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.install-text { flex: 1; }
.install-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--cs); }
.install-text small  { font-size: 12px; color: #888; }
.btn-install {
  padding: 8px 16px; border-radius: 8px; border: none;
  background: var(--cp); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  transition: opacity var(--trans);
}
.btn-install:active { opacity: .8; }
.install-close { margin-left: 4px; }

/* ─── iOS install ────────────────────────────────────────────────────────── */
.ios-install {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(0,0,0,.5); padding-bottom: env(safe-area-inset-bottom);
  animation: fadeIn .2s ease;
}
.ios-inner {
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 24px 24px 32px; text-align: center; position: relative;
}
.ios-close-btn {
  position: absolute; top: 16px; right: 16px;
  border: none; background: var(--csu); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; color: #666;
  display: flex; align-items: center; justify-content: center;
}
.ios-icon { width: 64px; height: 64px; border-radius: 14px; margin: 0 auto 12px; display: block; }
.ios-inner h3 { font-size: 18px; font-weight: 800; margin-bottom: 20px; }
.ios-steps { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.ios-steps li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 10px 14px;
  background: var(--csu); border-radius: 10px;
  counter-increment: step;
}
.ios-steps li::before {
  content: counter(step); counter-reset: step;
  background: var(--cp); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.ios-steps { counter-reset: step; }
.btn-primary {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: var(--cp); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: opacity var(--trans);
}
.btn-primary:active { opacity: .85; }

/* ─── Offline bar ────────────────────────────────────────────────────────── */
.offline-bar {
  position: fixed; top: var(--hh); left: 0; right: 0;
  background: #1f2937; color: #fff; font-size: 12px; font-weight: 600;
  padding: 8px 16px; display: flex; align-items: center; justify-content: center;
  gap: 8px; z-index: 99; animation: slideDown .3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: none; } }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nh) + env(safe-area-inset-bottom) + 70px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1f2937; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 24px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all .3s ease;
  max-width: calc(100% - 40px); text-align: center; z-index: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #10b981; }
.toast.error   { background: #ef4444; }

/* ─── Responsive tweaks ──────────────────────────────────────────────────── */
@media (min-width: 540px) {
  .articles-list   { padding: 12px 16px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Radar view (iframe) ────────────────────────────────────────────────── */
/* Retirer le padding-bottom de app-main sur la vue radar (l'iframe gère son layout) */
.app-main.has-radar { padding-bottom: 0; overflow: hidden; }

#view-radar {
  height: 100%;
  overflow: hidden;
  display: none;     /* remplacé par .active ci-dessous */
}
#view-radar.active { display: flex; flex-direction: column; }

.radar-frame {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: #f5f5f5;
}

/* ══════════════════════════════════════════════════════════
   STYLES D'AFFICHAGE DES ARTICLES
   ══════════════════════════════════════════════════════════ */

/* ─── 2. Compact horizontal ─────────────────────────────────────────────── */
.layout-horizontal { gap: 2px; padding: 8px 0; }
.layout-horizontal .article-card {
  flex-direction: row; align-items: center;
  border-radius: 0; border-left: none; border-right: none; box-shadow: none;
  border-bottom: 1px solid rgba(0,0,0,.07); border-top: none;
  padding: 0;
}
.layout-horizontal .article-card-img-wrap {
  width: 110px; min-width: 110px; height: 82px; flex-shrink: 0; overflow: hidden;
}
.layout-horizontal .article-card-img {
  width: 110px; height: 82px; aspect-ratio: unset; object-fit: cover;
}
.layout-horizontal .article-card-img-placeholder { width: 110px; height: 82px; aspect-ratio: unset; }
.layout-horizontal .article-card-body  { padding: 8px 12px 8px 10px; flex: 1; min-width: 0; }
.layout-horizontal .article-card-title { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.layout-horizontal .article-card-excerpt { display: none; }
.layout-horizontal .article-card-meta  { font-size: 11px; margin-top: 4px; }
.layout-horizontal .card-fav-btn { width: 28px; height: 28px; top: 4px; right: 4px; }
.layout-horizontal .card-fav-icon { width: 13px; height: 13px; }

/* ─── 2b. Liste grandes images (hauteur contrôlée par --card-img-h) ─────── */
.layout-horizontal-large { gap: 10px; padding: 8px 12px; }
.layout-horizontal-large .article-card {
  flex-direction: row; align-items: stretch; padding: 0;
  border-radius: var(--radius); overflow: hidden;
}
.layout-horizontal-large .article-card-img-wrap {
  width: calc(var(--card-img-h, 120px) * 1.34);
  min-width: calc(var(--card-img-h, 120px) * 1.34);
  height: var(--card-img-h, 120px);
  flex-shrink: 0; overflow: hidden; position: relative;
}
.layout-horizontal-large .article-card-img {
  width: 100%; height: 100%; aspect-ratio: unset; object-fit: cover;
}
.layout-horizontal-large .article-card-img-placeholder { width: 100%; height: 100%; aspect-ratio: unset; }
.layout-horizontal-large .article-card-body {
  padding: 12px 14px; flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.layout-horizontal-large .article-card-title {
  font-size: 14px; font-weight: 700; line-height: 1.35; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.layout-horizontal-large .article-card-cats { margin-bottom: 5px; }
.layout-horizontal-large .article-card-excerpt { display: none; }
.layout-horizontal-large .article-card-meta  { font-size: 11px; margin-top: auto; padding-top: 4px; }
.layout-horizontal-large .card-fav-btn       { width: 28px; height: 28px; top: 6px; right: 6px; }
.layout-horizontal-large .card-fav-icon      { width: 13px; height: 13px; }

/* ─── 3. Plein écran (scroll immersif) ──────────────────────────────────── */
.layout-fullscreen { gap: 12px; padding: 8px 0; }
.layout-fullscreen .article-card {
  position: relative; min-height: 78vh; border-radius: 0;
  border: none; box-shadow: none; overflow: hidden;
}
.layout-fullscreen .article-card-img-wrap {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.layout-fullscreen .article-card-img {
  width: 100%; height: 100%; aspect-ratio: unset; object-fit: cover;
}
.layout-fullscreen .article-card-img-placeholder { width: 100%; height: 100%; aspect-ratio: unset; }
.layout-fullscreen .article-card-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
  color: #fff; padding: 50px 16px 18px;
}
.layout-fullscreen .article-card-cat  { color: rgba(255,255,255,.75); }
.layout-fullscreen .article-card-title { font-size: 20px; color: #fff; }
.layout-fullscreen .article-card-excerpt { color: rgba(255,255,255,.75); display: none; }
.layout-fullscreen .article-card-meta { color: rgba(255,255,255,.6); }
.layout-fullscreen .card-fav-btn { top: 12px; right: 12px; background: rgba(255,255,255,.85); }

/* ─── 4. Overlay magazine ───────────────────────────────────────────────── */
.layout-overlay { gap: 10px; padding: 10px 12px; }
.layout-overlay .article-card {
  position: relative; min-height: 220px; overflow: hidden; border-radius: 14px;
  border: none; box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.layout-overlay .article-card-img-wrap {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.layout-overlay .article-card-img {
  width: 100%; height: 100%; aspect-ratio: unset; object-fit: cover;
}
.layout-overlay .article-card-img-placeholder { width: 100%; height: 100%; aspect-ratio: unset; background: #555; }
.layout-overlay .article-card-body {
  position: relative; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
  min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 40px 14px 14px; color: #fff;
}
.layout-overlay .article-card-cat { color: var(--cp); font-size: 10px; }
.layout-overlay .article-card-title { font-size: 16px; color: #fff; font-weight: 800; }
.layout-overlay .article-card-excerpt { display: none; }
.layout-overlay .article-card-meta { color: rgba(255,255,255,.65); font-size: 11px; }
