/* LGDP Site App — Espace privé — Identité visuelle harmonisée */

:root {
  --green-950: #0b1f14;
  --green-900: #102a1b;
  --green-800: #173b27;
  --green-700: #24523a;
  --green-600: #356c4c;
  --sand-50:  #fffaf0;
  --sand-100: #f8edd8;
  --sand-200: #ead7b4;
  --gold-500: #c89537;
  --gold-400: #ddb35b;
  --ink:   #1d1d1b;
  --muted: #665a48;
  --line:  rgba(29, 29, 27, .12);
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(11, 31, 20, .12);
  --max: 980px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(53, 108, 76, .14), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(200, 149, 55, .13), transparent 26rem),
    var(--sand-50);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 240, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--green-950);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.02em;
  font-size: .9rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(53, 108, 76, .2);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: .86rem;
  font-weight: 800;
}

.topnav a {
  text-decoration: none;
  opacity: .76;
  color: var(--ink);
}

.topnav a:hover { opacity: 1; color: var(--green-700); }

.badge-prive {
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px;
  background: rgba(53, 108, 76, .1);
  color: var(--green-700);
  border-radius: 999px;
}

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 18px 72px;
}

/* ── Page title ─────────────────────────────────────────── */
.page-title {
  margin: 0 0 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--green-950);
  letter-spacing: -.03em;
  line-height: 1.1;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px rgba(11, 31, 20, .08);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--green-900);
  letter-spacing: -.02em;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--green-900);
}

.card-dark {
  background: var(--green-900);
  color: var(--sand-50);
  border-color: transparent;
}

.card-dark h2, .card-dark h3 { color: var(--sand-50); }
.card-dark .muted { color: rgba(255,250,240,.7); }

/* ── Grid ───────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: .86rem;
  font-weight: 800;
  color: var(--green-800);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  font-size: .97rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--sand-50);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(53, 108, 76, .12);
  background: var(--white);
}

textarea { min-height: 90px; resize: vertical; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .92rem;
  font-family: inherit;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
}

.btn:hover { opacity: .88; }

.btn-primary {
  background: var(--gold-500);
  color: #171006;
  box-shadow: 0 10px 22px rgba(200, 149, 55, .22);
}

.btn-secondary {
  background: var(--white);
  color: var(--green-950);
  border: 1px solid var(--line);
}

.btn-danger {
  background: #aa1f1f;
  color: var(--white);
}

.btn-full { width: 100%; }

/* ── Feedback messages ──────────────────────────────────── */
.msg-error {
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(170, 31, 31, .08);
  border: 1px solid rgba(170, 31, 31, .22);
  color: #8b1515;
  font-weight: 700;
  margin-bottom: 16px;
  font-size: .94rem;
}

.msg-ok {
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(53, 108, 76, .08);
  border: 1px solid rgba(53, 108, 76, .22);
  color: var(--green-700);
  font-weight: 700;
  margin-bottom: 16px;
  font-size: .94rem;
}

/* ── Muted text ─────────────────────────────────────────── */
.muted { color: var(--muted); font-size: .95rem; }

/* ── Lists ──────────────────────────────────────────────── */
ul.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.clean-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}

ul.clean-list li:last-child { border-bottom: 0; }

/* ── Update articles ────────────────────────────────────── */
.update-article {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.update-article:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.update-article h3 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: var(--green-950);
}

.update-article .meta {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.update-article p { margin: 0 0 10px; font-size: .97rem; }

.update-article img {
  border-radius: 14px;
  max-width: 240px;
  margin-top: 8px;
  border: 1px solid var(--line);
}

/* ── Admin redesign and shared photo framing ───────────── */
.section-title-light { color: rgba(255, 250, 240, .72); }

.admin-shell { display: grid; gap: 22px; }

.container.admin-shell {
  max-width: 1120px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.05fr);
  gap: 22px;
  align-items: start;
  background:
    radial-gradient(circle at top left, rgba(200, 149, 55, .12), transparent 34%),
    linear-gradient(180deg, rgba(16, 42, 27, .98), rgba(11, 31, 20, .98));
}

.admin-hero .page-title { color: var(--sand-50); margin-bottom: 14px; }

.admin-hero .muted { color: rgba(255, 250, 240, .72); }

.admin-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-quick-link {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--green-950);
  background: rgba(255, 250, 240, .98);
  border: 1px solid rgba(255, 250, 240, .18);
  border-radius: 20px;
  padding: 16px 16px 15px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .16);
  transition: transform .15s ease, box-shadow .15s ease;
}

.admin-quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .22);
}

.quick-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(53, 108, 76, .12);
  color: var(--green-800);
  font-weight: 900;
}

.admin-quick-link strong {
  display: block;
  font-size: 1rem;
  color: var(--green-950);
}

.admin-quick-link span {
  color: var(--muted);
  font-size: .92rem;
}

.admin-section { scroll-margin-top: 92px; }

.admin-section + .admin-section { margin-top: 22px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.section-head.compact { margin-bottom: 14px; }

.section-head h2,
.section-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--green-950);
}

.section-head h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.section-head h3 { font-size: 1.22rem; }

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.admin-form { display: grid; gap: 0; }

.form-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.frame-controls {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(248, 237, 216, .4);
  border: 1px solid var(--line);
}

.frame-control { display: grid; gap: 8px; }

.frame-control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--green-950);
  font-weight: 800;
  font-size: .9rem;
}

.frame-control-head label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
  color: var(--green-950);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green-600);
}

.frame-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.admin-preview {
  display: grid;
  gap: 12px;
  align-self: start;
}

.admin-preview .article-preview-card {
  width: min(1120px, calc(100vw - 36px));
  justify-self: center;
}

.preview-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
}

.preview-content {
  margin: 0;
}

.preview-note { margin: 0; }

.article-preview-card,
.post {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 18px 42px rgba(11, 31, 20, .09);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-preview-body,
.post-body {
  padding: 24px 28px;
  min-height: 150px;
}

.article-preview-body:last-child,
.post-body:last-child {
  padding-bottom: 24px;
}

.article-preview-body h1,
.article-preview-body h2,
.post-body h1,
.post-body h2,
.post-title {
  margin: 0;
}

.article-content,
.preview-content {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
  white-space: pre-line;
}

.article-photo-frame,
.photo-frame {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(16, 42, 27, .08), rgba(16, 42, 27, .02)),
    var(--sand-100);
  border: 1px solid var(--line);
  min-height: 0;
  aspect-ratio: 531 / 310;
  margin: 0 28px 28px;
  --focus-x: 50%;
  --focus-y: 50%;
  --zoom: 1;
}

.article-photo-frame {
  height: auto;
}

.article-photo-img,
.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--focus-x) var(--focus-y);
  transform: scale(var(--zoom));
  /* L'ancrage du zoom suit le point de focus réel pour préserver la perception du déplacement horizontal. */
  transform-origin: var(--focus-x) var(--focus-y);
}

/* Cadre partagé pour les actualités: proportions fixes pour que le crop soit visible partout. */
.photo-frame-actualite,
.photo-frame-list,
.admin-preview-frame,
.admin-edit-frame {
  min-height: 0;
  aspect-ratio: 531 / 310;
}

.photo-frame.has-image .photo-placeholder {
  display: none;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(29, 29, 27, .6);
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(53, 108, 76, .06), rgba(200, 149, 55, .08)),
    var(--sand-100);
}

.photo-frame-list {
  margin-top: 12px;
}

.admin-edit-frame {
  margin-top: 10px;
}

.admin-list {
  display: grid;
  gap: 16px;
}

.admin-item,
.admin-item-soft {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 28px rgba(11, 31, 20, .06);
}

.admin-item-soft { background: rgba(248, 237, 216, .42); }

.admin-item-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.admin-item-top h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  color: var(--green-950);
}

.admin-item-content {
  margin: 14px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-item-actions form { margin: 0; }

.admin-edit {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-edit summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--green-700);
  margin-bottom: 14px;
}

.stack { display: grid; gap: 18px; }

.inner-card {
  margin-bottom: 0;
  padding: 22px;
  border-radius: 22px;
}

.linked-users { margin-top: 14px; }

.linked-users-title {
  margin: 0 0 8px;
  font-weight: 900;
  color: var(--green-800);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.linked-users-list {
  gap: 0;
}

.post-link {
  color: var(--green-700);
  text-decoration: none;
  font-weight: 900;
}

.post-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-top: 8px;
}

.post-meta {
  color: var(--muted);
  font-size: .92rem;
  margin: 12px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: rgba(53, 108, 76, .10);
  color: var(--green-700);
}

.status-draft { background: rgba(102, 90, 72, .10); color: var(--muted); }
.status-published { background: rgba(53, 108, 76, .12); color: var(--green-700); }
.status-active,
.status-lu { background: rgba(53, 108, 76, .12); color: var(--green-700); }
.status-archived { background: rgba(29, 29, 27, .08); color: var(--muted); }
.status-new { background: rgba(200, 149, 55, .14); color: #8a6100; }
.status-nouveau { background: rgba(200, 149, 55, .14); color: #8a6100; }
.status-archive { background: rgba(29, 29, 27, .08); color: var(--muted); }

.section-spacer { height: 8px; }

/* ── Section separators ─────────────────────────────────── */
.section-sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* ── Admin section header ───────────────────────────────── */
.section-title {
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-600);
  margin: 0 0 14px;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--green-950);
  color: rgba(255, 250, 240, .7);
  text-align: center;
  padding: 28px 18px;
  font-size: .88rem;
}

footer strong { color: var(--sand-50); }

/* ── Auth layout (login / register) ────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 18px;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 44px;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow);
}

.auth-card .page-title { margin-bottom: 24px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }

  .auth-card { padding: 28px 22px; }

  .card { padding: 20px 18px; }

  .topbar-inner { padding: 0 14px; }

  .admin-hero,
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-quick-links {
    grid-template-columns: 1fr;
  }

  .admin-preview {
    position: static;
  }

  .section-head,
  .admin-item-top,
  .frame-control-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .frame-actions {
    justify-content: stretch;
  }

  .frame-actions .btn,
  .admin-item-actions .btn {
    width: 100%;
  }

  .admin-item-actions,
  .frame-actions {
    flex-direction: column;
  }
}
