/* ---------------------------------------------------------------------
   Site vitrine — feuille de style unique (site public + administration).
   Pas de framework externe : variables CSS + un peu de flexbox/grid.
--------------------------------------------------------------------- */

:root {
  --accent: #2563eb;
  --accent-dark: #1e4fc4;
  --ink: #16181d;
  --ink-soft: #4b5563;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--body-text, var(--ink));
  background: var(--body-bg, var(--bg));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-block;
  padding: .7em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink-soft); }
.btn-small { padding: .4em .9em; font-size: .82rem; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--ink-soft);
}
.btn-icon:hover { background: var(--bg-soft); }
.btn-icon.disabled { opacity: .3; cursor: default; }
.btn-icon-danger:hover { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.inline-form { display: inline-block; margin: 0 2px; vertical-align: middle; }

/* ---------------- Header / nav ---------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--header-bg, #ffffff);
  z-index: 50; color: var(--header-text, var(--ink));
  min-height: var(--header-height, auto); display: flex; align-items: center;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 16px; width: 100%; }
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--header-text, var(--ink)); }
.site-brand:hover { text-decoration: none; }
.site-logo-img { height: 36px; width: auto; max-height: 120px; }
.site-logo-badge {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.site-name { font-weight: 700; font-size: 1.05rem; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav-link {
  padding: .5em .9em; border-radius: 999px; color: var(--header-text, var(--ink-soft)); opacity: .8; font-weight: 600; font-size: .93rem;
}
.nav-link:hover, .nav-link.active { background: rgba(127,127,127,.12); opacity: 1; color: var(--header-text, var(--ink)); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--header-text, var(--ink)); }
.lang-switcher { display: flex; gap: 2px; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border); }
.lang-option { padding: .35em .6em; border-radius: 6px; font-size: .78rem; font-weight: 700; color: var(--header-text, var(--ink-soft)); opacity: .7; }
.lang-option:hover, .lang-option.active { opacity: 1; background: rgba(127,127,127,.12); text-decoration: none; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bg, #fff);
    border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; padding: 10px 20px;
  }
  .site-nav.open { display: flex; }
  .lang-switcher { border-left: none; padding-left: 0; margin-left: 0; margin-top: 8px; }
}

@media (max-width: 480px) {
  input[type=text], input[type=email], input[type=password], textarea, select {
    font-size: 16px; /* évite le zoom automatique de Safari iOS au focus */
  }
  .review-card, .post-card-body, .contact-wrap, .review-form, .contact-form { font-size: .95rem; }
}

/* ---------------- Hero / contenu de page ---------------- */
.page-hero { padding: 56px 0 28px; }
.page-hero h1 { margin-bottom: .2em; }
.page-hero-subtitle { color: var(--ink-soft); font-size: 1.1rem; max-width: 640px; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }

.home-hero { position: relative; padding: 90px 0; overflow: hidden; }
.home-hero-no-title { padding: 34px 0; }
.home-hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .18; z-index: -1;
}
.home-hero h1 { font-size: 2.6rem; }

@media (max-width: 640px) {
  .home-hero { padding: 60px 0; }
  .home-hero-no-title { padding: 24px 0; }
  .home-hero h1 { font-size: 1.85rem; }
  .page-hero { padding: 40px 0 22px; }
  .page-hero h1 { font-size: 1.6rem; }
  .page-hero-subtitle { font-size: 1rem; }
}

.page-hero-image img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); }
.page-content { padding-top: 26px; padding-bottom: 40px; max-width: 760px; }
.page-content h2 { margin-top: 1.2em; }
.page-content img { border-radius: var(--radius); margin: 1em 0; display: inline-block; vertical-align: top; }
.page-content ul, .page-content ol { padding-left: 1.4em; }
.page-content a { text-decoration: underline; }
.post-date { color: var(--ink-soft); font-size: .9rem; }

/* ---------------- Commentaires d'article ---------------- */
.comments-section { padding-top: 20px; padding-bottom: 60px; }
.comments-section-inner { max-width: 760px; margin: 0 auto; }
.comments-list { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 28px; }
.comment-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.comment-author { font-weight: 700; margin: 0 0 .3em; overflow-wrap: anywhere; word-break: break-word; }
.comment-text { margin: 0 0 .4em; overflow-wrap: anywhere; word-break: break-word; }
.comment-date { color: var(--ink-soft); font-size: .78rem; margin: 0; }
.comment-form { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }

/* ---------------- Cartes d'articles ---------------- */
.posts-section { padding-top: 20px; padding-bottom: 60px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.post-card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--ink);
  display: flex; flex-direction: column; background: #fff; transition: box-shadow .15s, transform .15s;
  height: 100%; width: 100%; max-width: 100%; box-sizing: border-box;
}
.post-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.post-card-cover { flex-shrink: 0; height: 170px; overflow: hidden; background: var(--bg-soft); }
.post-card-cover img { height: 100%; width: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; min-width: 0; max-width: 100%; box-sizing: border-box; }
.post-card-body h3 {
  margin: 0 0 .3em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.5em; overflow-wrap: anywhere; word-break: break-word; white-space: normal;
  min-width: 0; max-width: 100%;
}
.post-card-date { color: var(--ink-soft); font-size: .82rem; display: block; margin-bottom: .4em; }
.post-card-body p {
  color: var(--ink-soft); font-size: .92rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
  min-width: 0; max-width: 100%;
}

/* ---------------- Avis clients ---------------- */
.reviews-strip { background: var(--bg-soft); padding: 50px 0; margin-top: 10px; }
.reviews-strip h2 { text-align: center; margin-bottom: 1.2em; }
.reviews-strip .btn { display: block; width: fit-content; margin: 20px auto 0; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-bottom: 10px; }
.review-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.review-comment {
  color: var(--ink-soft); font-size: .93rem;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
  min-width: 0; max-width: 100%;
}
.review-author { font-weight: 600; margin: 0; font-size: .9rem; }
.stars { color: #f59e0b; letter-spacing: 2px; display: block; margin-bottom: .4em; }
.empty-note { color: var(--ink-soft); font-style: italic; }

/* ---------------- Carrousel générique (avis, articles) ---------------- */
.item-carousel { margin-top: 10px; }
.item-carousel-viewport { overflow: hidden; width: 100%; }
.item-carousel-track { display: flex; transition: transform .35s ease; align-items: stretch; }
.item-carousel-slide {
  flex-shrink: 0; padding: 0 8px; box-sizing: border-box; display: flex; align-items: stretch;
  min-width: 0; overflow: hidden;
}
.item-carousel-slide > * { width: 100%; height: 100%; min-width: 0; max-width: 100%; }
.item-carousel-controls { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.item-carousel-nav {
  background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 40px; height: 40px;
  font-size: 1.1rem; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.item-carousel-nav:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--accent); color: var(--accent); }
.item-carousel-nav:disabled { opacity: .3; cursor: default; }

@media (max-width: 640px) {
  .item-carousel-slide { padding: 0 5px; }
}

/* ---------------- Galerie d'images ---------------- */
.gallery-section { padding-top: 20px; padding-bottom: 50px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery-item:hover img { transform: scale(1.04); }

.gallery-carousel { position: relative; }
.gallery-carousel-viewport { overflow: hidden; border-radius: var(--radius); }
.gallery-carousel-track { display: flex; transition: transform .35s ease; }
.gallery-carousel-slide { flex: 0 0 100%; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.gallery-carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.gallery-carousel-nav:hover { background: rgba(0,0,0,.75); }
.gallery-carousel-prev { left: 12px; }
.gallery-carousel-next { right: 12px; }
.gallery-carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.gallery-carousel-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; padding: 0; }
.gallery-carousel-dot.active { background: var(--accent); }

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .gallery-carousel-nav { width: 36px; height: 36px; font-size: 1.2rem; }
}

/* ---------------- Carte Google Maps ---------------- */
.map-section { padding-top: 10px; padding-bottom: 50px; }
.map-embed { position: relative; width: 100%; padding-top: 45%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-theme-grayscale iframe { filter: grayscale(1) contrast(1.05); }
.map-theme-dark iframe { filter: invert(90%) hue-rotate(180deg) grayscale(0.15) brightness(0.95) contrast(0.9); }
@media (max-width: 640px) {
  .map-embed { padding-top: 75%; }
}

/* ---------------- Agrandissement au clic (lightbox) ---------------- */
.page-content img, .gallery-item img, .gallery-carousel-slide img { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10,10,14,.92); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,.5); cursor: default; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; border: none; font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

@media (max-width: 480px) {
  .lightbox-overlay { padding: 14px; }
  .lightbox-close { top: 8px; right: 8px; width: 36px; height: 36px; }
}

/* ---------------- Formulaires (contact / avis) ---------------- */
.contact-wrap { max-width: 560px; padding-bottom: 60px; }
.intro-center { text-align: center; }
.contact-form, .review-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 2px; }
input[type=text], input[type=email], input[type=password], input[type=color], textarea, select {
  width: 100%; padding: .65em .8em; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: .96rem; margin-top: 4px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { background: #fee2e2; color: #991b1b; padding: .8em 1em; border-radius: 8px; font-size: .92rem; }
.form-success { background: #dcfce7; color: #166534; padding: .8em 1em; border-radius: 8px; font-size: .92rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--footer-bg, var(--bg-soft)); color: var(--footer-text, var(--ink-soft)); min-height: var(--footer-height, auto); display: flex; align-items: center; }
.footer-inner { padding: 34px 20px; text-align: center; font-size: .88rem; width: 100%; }
.footer-name { font-weight: 700; color: inherit; margin-bottom: .3em; }
.social-links { display: flex; justify-content: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.social-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid currentColor; opacity: .75;
  display: flex; align-items: center; justify-content: center; color: inherit;
}
.social-icon:hover { opacity: 1; text-decoration: none; }
.social-icon svg { width: 18px; height: 18px; }
.social-icon-text { width: auto; height: auto; border-radius: 999px; padding: .4em .9em; font-size: .8rem; font-weight: 600; }
.footer-text { max-width: 560px; margin: 0 auto 10px; }
.footer-copy { margin: 0; }

/* ---------------- Page d'erreur / 404 ---------------- */
.error-page { padding-top: 90px; padding-bottom: 90px; text-align: center; }

/* ---------------- Page "en construction" ---------------- */
.maintenance-body { margin: 0; min-height: 100vh; }
.maintenance-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; max-width: 560px; margin: 0 auto;
}
.maintenance-logo-img { max-height: 72px; width: auto; margin-bottom: 24px; }
.maintenance-logo-badge {
  display: flex; align-items: center; justify-content: center; width: 64px; height: 64px;
  border-radius: 50%; background: rgba(255,255,255,.12); font-size: 26px; font-weight: 700;
  margin-bottom: 24px;
}
.maintenance-page h1 { font-size: 1.8rem; margin: 0 0 14px; }
.maintenance-page p { font-size: 1rem; opacity: .85; line-height: 1.6; margin: 0; }

/* =======================================================================
   Administration
======================================================================= */
.admin-body { background: var(--bg-soft); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: #14171f; color: #d7dae1; display: flex; flex-direction: column;
  padding: 20px 14px; flex-shrink: 0;
}
.admin-sidebar-brand { font-weight: 700; color: #fff; padding: 6px 10px 18px; font-size: 1.05rem; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav-link {
  color: #b7bcc8; padding: .6em .8em; border-radius: 8px; font-size: .92rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.admin-nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #ffffff; opacity: .85; }
.admin-nav-icon svg { width: 100%; height: 100%; }
.admin-nav-link.active .admin-nav-icon, .admin-nav-link:hover .admin-nav-icon { opacity: 1; }
.admin-nav-text { flex: 1; }
.admin-nav-link:hover, .admin-nav-link.active { background: #232735; color: #fff; text-decoration: none; }
.admin-nav-badge {
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem;
  padding: 1px 7px; font-weight: 700;
}
.admin-sidebar-footer { border-top: 1px solid #2a2e3d; padding-top: 14px; margin-top: 14px; }
.admin-lang-switcher { display: flex; gap: 4px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid #2a2e3d; }
.admin-lang-option {
  flex: 1; text-align: center; padding: .4em 0; border-radius: 6px; font-size: .74rem; font-weight: 700;
  color: #8a90a0; border: 1px solid #2a2e3d;
}
.admin-lang-option:hover, .admin-lang-option.active { background: #232735; color: #fff; text-decoration: none; }
.admin-account { color: #8a90a0; font-size: .8rem; margin: 0 0 8px; word-break: break-all; }
.admin-sidebar-footer .btn-ghost { color: #d7dae1; border-color: #3a3f52; width: 100%; margin-bottom: 8px; }
.admin-back-link { color: #8a90a0; font-size: .82rem; display: block; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 18px 30px; }
.admin-topbar h1 { margin: 0; font-size: 1.3rem; }
.admin-content { padding: 24px 30px 60px; max-width: 980px; }

.admin-flash { padding: .8em 1.1em; border-radius: 8px; margin-bottom: 18px; font-weight: 600; font-size: .92rem; }
.admin-flash-success { background: #dcfce7; color: #166534; }
.admin-flash-error { background: #fee2e2; color: #991b1b; }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  color: var(--ink); display: flex; flex-direction: column; gap: 4px;
}
.dash-card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.dash-num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.quick-list { padding-left: 1.2em; }
.quick-list li { margin-bottom: .5em; }

.stats-cards { margin-bottom: 20px; }
.stats-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px;
  border-bottom: 1px solid var(--border);
}
.stats-bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 4px; }
.stats-bar { width: 100%; max-width: 18px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; transition: opacity .15s; }
.stats-bar-col:hover .stats-bar { opacity: 1; }
.stats-bar-label { font-size: .65rem; color: var(--muted, #888); margin-top: 4px; }
.stats-table-wrap code, .admin-table code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .82em; }

.admin-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.reviews-toggle-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.reviews-toggle-panel p.field-hint { margin: 4px 0 0; max-width: 480px; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-panel-head p { margin: 0; color: var(--ink-soft); font-size: .92rem; max-width: 560px; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.admin-table-wrap .admin-table { border-radius: 0; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; vertical-align: middle; }
.admin-table th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-unread { background: #eff6ff; }
.order-cell { white-space: nowrap; }
.actions-cell { white-space: nowrap; }
.review-preview { color: var(--ink-soft); font-size: .82rem; margin-top: 2px; }

.tag { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg-soft); color: var(--ink-soft); }
.tag-success { background: #dcfce7; color: #166534; }
.tag-muted { background: #f1f2f4; color: #6b7280; }
.tag-accent { background: var(--accent); color: #fff; }

.admin-form .form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.checkbox-label input { width: auto; margin: 0; }
.field-hint { color: var(--ink-soft); font-size: .82rem; margin: 4px 0 0; }
.message-body { white-space: pre-wrap; background: var(--bg-soft); border-radius: 8px; padding: 16px; margin: 16px 0; }
.custom-css-textarea { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .85rem; min-height: 200px; }

/* Gestionnaire de galerie (admin) */
.gallery-manager-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; min-height: 10px; }
.gallery-thumb {
  position: relative; width: 100px; height: 80px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); cursor: grab; background: var(--bg-soft);
}
.gallery-thumb.dragging { opacity: .4; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gallery-thumb-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; font-size: .8rem; cursor: pointer; line-height: 1;
}
.gallery-thumb-remove:hover { background: var(--danger); }

/* Gestionnaire des réseaux sociaux personnalisés */
.social-custom-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.social-custom-row { display: flex; gap: 8px; align-items: center; }
.social-custom-row input { flex: 1; margin-top: 0; }

/* Réseaux sociaux avec icône de marque (Configuration) */
.social-fields-list { display: flex; flex-direction: column; }
.social-field-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.social-field-row:last-child { border-bottom: none; padding-bottom: 0; }
.social-field-icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--bg-soft); color: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.social-field-icon svg { width: 22px; height: 22px; }
.social-field-icon-facebook { background: #e7f0ff; color: #1877f2; }
.social-field-icon-instagram { background: #fdeef4; color: #d6249f; }
.social-field-icon-linkedin { background: #e8f3fb; color: #0a66c2; }
.social-field-icon-twitter { background: #f2f2f2; color: #14171a; }
.social-field-icon-youtube { background: #fdeaea; color: #ff0000; }
.social-field-icon-snapchat { background: #fffbe0; color: #b89400; }
.social-field-input { flex: 1; min-width: 0; }
.social-field-input label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.social-field-input input { width: 100%; font-size: .95rem; padding: .7em .9em; }
@media (max-width: 560px) {
  .social-field-row { gap: 12px; }
  .social-field-icon { width: 36px; height: 36px; }
  .social-field-icon svg { width: 18px; height: 18px; }
}

/* Bouton d'enregistrement flottant, unique, toujours en haut à droite —
   position fixe (pas "sticky") pour qu'il ne puisse jamais sembler se
   dupliquer visuellement pendant le défilement. */
.sticky-save-bar {
  position: fixed; top: 14px; right: 30px; z-index: 60;
  margin: 0; padding: 0;
  display: block;
}
.sticky-save-bar .btn { box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* Cartes de couleur par section (Configuration → Couleurs par section) */
.color-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.color-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fff; }
.color-card h3 { margin: 0 0 10px; font-size: .95rem; }
.color-preview {
  border-radius: 8px; padding: 22px 14px; margin-bottom: 14px; font-weight: 700; text-align: center;
  border: 1px solid var(--border); transition: background .15s, color .15s;
}
.color-card-inputs { display: flex; flex-direction: column; gap: 10px; }
.color-input-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.color-sync-pair { display: flex; align-items: center; gap: 6px; }
.color-input-row input[type=color], .color-sync-pair input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; margin: 0; flex-shrink: 0; }
.color-hex-input {
  width: 88px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .82rem;
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; color: var(--ink); margin: 0; text-transform: lowercase;
}
.color-hex-input:invalid { border-color: var(--danger); }
.color-image-field { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.color-image-field .image-field { margin-top: 8px; }

/* Éditeur riche */
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--border); border-bottom: none; background: var(--bg-soft); border-radius: 8px 8px 0 0; padding: 6px; }
.rich-toolbar button { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 9px; cursor: pointer; font-size: .85rem; color: var(--ink); }
.rich-toolbar button:hover { background: #fff; border-color: var(--border); }
.rich-toolbar button.active { background: #e0e7ff; border-color: #c7d2fe; }
.rich-toolbar .toolbar-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.rich-toolbar select { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: .82rem; background: #fff; margin-top: 0; }
.rich-toolbar input[type=color] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.rich-toolbar label.color-btn { display: flex; align-items: center; gap: 3px; font-size: .8rem; color: var(--ink-soft); cursor: pointer; padding: 0 4px; }
.rich-editor-wrap { position: relative; }
.rich-editor {
  border: 1px solid var(--border); border-radius: 0 0 8px 8px; min-height: 220px; padding: 14px 16px;
  font-size: .96rem; background: #fff; position: relative;
}
.rich-editor:focus { outline: none; border-color: var(--accent); }
.rich-editor img { max-width: 100%; border-radius: 6px; cursor: pointer; display: inline-block; vertical-align: top; }
.rich-editor img.re-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.rich-editor h2 { font-size: 1.3rem; } .rich-editor h3 { font-size: 1.1rem; } .rich-editor h4 { font-size: 1rem; }
.rich-editor blockquote { border-left: 3px solid var(--accent); margin: 0; padding-left: 14px; color: var(--ink-soft); }
.rich-editor table, .page-content table, .post-card-body table {
  border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .92em;
}
.rich-editor table th, .rich-editor table td,
.page-content table th, .page-content table td {
  border: 1px solid var(--border); padding: .5em .7em; text-align: left; vertical-align: top;
}
.rich-editor table th, .page-content table th { background: var(--bg-soft); font-weight: 700; }
.rich-editor table tr:hover, .page-content table tr:hover { background: rgba(37,99,235,.04); }
@media (max-width: 640px) {
  .page-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Overlay de sélection d'image (déplacement/redimensionnement/suppression) */
.re-image-toolbar {
  position: absolute; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--ink); border-radius: 6px;
  padding: 3px; box-shadow: 0 4px 10px rgba(0,0,0,.2); max-width: 320px;
}
.re-image-toolbar button {
  background: transparent; border: none; color: #fff; font-size: .78rem; cursor: pointer; padding: 3px 7px; border-radius: 4px; white-space: nowrap;
}
.re-image-toolbar button:hover { background: rgba(255,255,255,.15); }
.re-toolbar-sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.2); margin: 2px 2px; }
.re-resize-handle {
  position: absolute; z-index: 5; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff;
  border-radius: 50%; cursor: nwse-resize; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Langues (admin) */
.lang-table .tag-default { background: #e0e7ff; color: #3730a3; }
.translation-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.translation-tab-btn {
  padding: .55em 1em; border-radius: 8px 8px 0 0; font-weight: 600; font-size: .88rem; color: var(--ink-soft);
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.translation-tab-btn.active { color: var(--accent); border-color: var(--border); border-bottom-color: #fff; background: #fff; margin-bottom: -1px; }
.translation-panel { display: none; }
.translation-panel.active { display: block; }
.translation-copy-btn { margin-bottom: 14px; }

/* Onglets de premier niveau (Configuration) — mêmes mécanique que les
   onglets de traduction, mais en plus visible puisqu'ils structurent
   toute la page plutôt qu'un sous-bloc. */
.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.settings-tab-btn {
  padding: .7em 1.3em; border-radius: 8px 8px 0 0; font-weight: 700; font-size: .92rem; color: var(--ink-soft);
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.settings-tab-btn.active { color: var(--accent); border-color: var(--border); border-bottom-color: #fff; background: #fff; margin-bottom: -2px; }
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

/* Champ image (couverture / logo) */
.image-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.image-preview { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.image-preview-empty { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: .78rem; background: var(--bg-soft); text-align: center; padding: 4px; }

/* Connexion admin */
.login-wrap { display: flex; justify-content: center; padding: 90px 20px; }
.login-form {
  width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 14px;
}
.login-form h1 { font-size: 1.3rem; text-align: center; margin-bottom: .3em; }
.login-form button { margin-top: 8px; }
.demo-notice {
  background: #eef4ff; border-left: 4px solid var(--accent, #2563eb); border-radius: 6px;
  padding: 10px 14px; font-size: .88rem; color: #1e3a8a;
}
.demo-notice strong { display: block; margin-bottom: 3px; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-lang-switcher { margin: 0; padding: 0; border-bottom: none; }
  .admin-sidebar-footer { margin-left: auto; border: none; padding: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .admin-account { display: none; }
  .admin-content { padding: 20px; }
  .admin-topbar { padding: 14px 20px; }
}

@media (max-width: 560px) {
  .admin-nav-text { display: none; }
  .admin-nav-link { padding: .55em; gap: 4px; }
  .admin-nav-icon { width: 22px; height: 22px; }
  .dash-cards { grid-template-columns: 1fr; }
  .color-cards-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 14px; }
  .sticky-save-bar { top: auto; bottom: 14px; right: 14px; }
  .sticky-save-bar .btn { padding: .6em 1em; font-size: .85rem; }
  input[type=text], input[type=email], input[type=password], textarea, select {
    font-size: 16px; /* évite le zoom automatique de Safari iOS au focus */
  }
}
